1 // Copyright 2014 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 6 7 #include "config.h" 8 #include "V8TestInterfaceEmpty.h" 9 10 #include "bindings/core/v8/ExceptionState.h" 11 #include "bindings/core/v8/V8DOMConfiguration.h" 12 #include "bindings/core/v8/V8HiddenValue.h" 13 #include "bindings/core/v8/V8ObjectConstructor.h" 14 #include "core/dom/ContextFeatures.h" 15 #include "core/dom/Document.h" 16 #include "platform/RuntimeEnabledFeatures.h" 17 #include "platform/TraceEvent.h" 18 #include "wtf/GetPtr.h" 19 #include "wtf/RefPtr.h" 20 21 namespace blink { 22 23 const WrapperTypeInfo V8TestInterfaceEmpty::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceEmpty::domTemplate, V8TestInterfaceEmpty::refObject, V8TestInterfaceEmpty::derefObject, V8TestInterfaceEmpty::createPersistentHandle, 0, 0, 0, V8TestInterfaceEmpty::installConditionallyEnabledMethods, V8TestInterfaceEmpty::installConditionallyEnabledProperties, 0, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::ObjectClassId, WrapperTypeInfo::Independent, WrapperTypeInfo::RefCountedObject }; 24 25 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfaceEmpty.h. 26 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in 27 // bindings/core/v8/ScriptWrappable.h. 28 const WrapperTypeInfo& TestInterfaceEmpty::s_wrapperTypeInfo = V8TestInterfaceEmpty::wrapperTypeInfo; 29 30 namespace TestInterfaceEmptyV8Internal { 31 32 template <typename T> void V8_USE(T) { } 33 34 } // namespace TestInterfaceEmptyV8Internal 35 36 static void installV8TestInterfaceEmptyTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate) 37 { 38 functionTemplate->ReadOnlyPrototype(); 39 40 v8::Local<v8::Signature> defaultSignature; 41 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceEmpty", v8::Local<v8::FunctionTemplate>(), V8TestInterfaceEmpty::internalFieldCount, 42 0, 0, 43 0, 0, 44 0, 0, 45 isolate); 46 v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate(); 47 v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate(); 48 49 // Custom toString template 50 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate()); 51 } 52 53 v8::Handle<v8::FunctionTemplate> V8TestInterfaceEmpty::domTemplate(v8::Isolate* isolate) 54 { 55 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceEmptyTemplate); 56 } 57 58 bool V8TestInterfaceEmpty::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) 59 { 60 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value); 61 } 62 63 v8::Handle<v8::Object> V8TestInterfaceEmpty::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate) 64 { 65 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value); 66 } 67 68 TestInterfaceEmpty* V8TestInterfaceEmpty::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value) 69 { 70 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestInterfaceEmpty>() : 0; 71 } 72 73 74 void V8TestInterfaceEmpty::refObject(ScriptWrappableBase* internalPointer) 75 { 76 internalPointer->toImpl<TestInterfaceEmpty>()->ref(); 77 } 78 79 void V8TestInterfaceEmpty::derefObject(ScriptWrappableBase* internalPointer) 80 { 81 internalPointer->toImpl<TestInterfaceEmpty>()->deref(); 82 } 83 84 WrapperPersistentNode* V8TestInterfaceEmpty::createPersistentHandle(ScriptWrappableBase* internalPointer) 85 { 86 ASSERT_NOT_REACHED(); 87 return 0; 88 } 89 90 template<> 91 v8::Handle<v8::Value> toV8NoInline(TestInterfaceEmpty* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) 92 { 93 return toV8(impl, creationContext, isolate); 94 } 95 96 } // namespace blink 97