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.
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
8 #include "V8TestInterfaceDocument.h"
10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/ScriptController.h"
12 #include "bindings/core/v8/V8DOMConfiguration.h"
13 #include "bindings/core/v8/V8HiddenValue.h"
14 #include "bindings/core/v8/V8ObjectConstructor.h"
15 #include "bindings/core/v8/WindowProxy.h"
16 #include "core/dom/ContextFeatures.h"
17 #include "core/dom/Document.h"
18 #include "core/frame/LocalFrame.h"
19 #include "platform/RuntimeEnabledFeatures.h"
20 #include "platform/TraceEvent.h"
21 #include "wtf/GetPtr.h"
22 #include "wtf/RefPtr.h"
26 const WrapperTypeInfo V8TestInterfaceDocument::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfaceDocument::domTemplate, V8TestInterfaceDocument::refObject, V8TestInterfaceDocument::derefObject, V8TestInterfaceDocument::createPersistentHandle, 0, V8TestInterfaceDocument::toEventTarget, 0, V8TestInterfaceDocument::installConditionallyEnabledMethods, V8TestInterfaceDocument::installConditionallyEnabledProperties, &V8Document::wrapperTypeInfo, WrapperTypeInfo::WrapperTypeObjectPrototype, WrapperTypeInfo::NodeClassId, WrapperTypeInfo::Dependent, WrapperTypeInfo::WillBeGarbageCollectedObject };
28 // This static member must be declared by DEFINE_WRAPPERTYPEINFO in TestInterfaceDocument.h.
29 // For details, see the comment of DEFINE_WRAPPERTYPEINFO in
30 // bindings/core/v8/ScriptWrappable.h.
31 const WrapperTypeInfo& TestInterfaceDocument::s_wrapperTypeInfo = V8TestInterfaceDocument::wrapperTypeInfo;
33 namespace TestInterfaceDocumentV8Internal {
35 template <typename T> void V8_USE(T) { }
37 } // namespace TestInterfaceDocumentV8Internal
39 static void installV8TestInterfaceDocumentTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
41 functionTemplate->ReadOnlyPrototype();
43 v8::Local<v8::Signature> defaultSignature;
44 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceDocument", V8Document::domTemplate(isolate), V8TestInterfaceDocument::internalFieldCount,
49 v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
50 v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();
52 // Custom toString template
53 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
56 v8::Handle<v8::FunctionTemplate> V8TestInterfaceDocument::domTemplate(v8::Isolate* isolate)
58 return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceDocumentTemplate);
61 bool V8TestInterfaceDocument::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
63 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
66 v8::Handle<v8::Object> V8TestInterfaceDocument::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
68 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
71 TestInterfaceDocument* V8TestInterfaceDocument::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
73 return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestInterfaceDocument>() : 0;
76 EventTarget* V8TestInterfaceDocument::toEventTarget(v8::Handle<v8::Object> object)
78 return toImpl(object);
82 void V8TestInterfaceDocument::refObject(ScriptWrappableBase* internalPointer)
85 internalPointer->toImpl<TestInterfaceDocument>()->ref();
89 void V8TestInterfaceDocument::derefObject(ScriptWrappableBase* internalPointer)
92 internalPointer->toImpl<TestInterfaceDocument>()->deref();
96 WrapperPersistentNode* V8TestInterfaceDocument::createPersistentHandle(ScriptWrappableBase* internalPointer)
99 return WrapperPersistent<TestInterfaceDocument>::create(internalPointer->toImpl<TestInterfaceDocument>());
101 ASSERT_NOT_REACHED();
107 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
109 return toV8(impl, creationContext, isolate);