Home | History | Annotate | Download | only in core
      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 "V8TestInterfaceDocument.h"
      9 
     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"
     23 
     24 namespace blink {
     25 
     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 };
     27 
     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;
     32 
     33 namespace TestInterfaceDocumentV8Internal {
     34 
     35 template <typename T> void V8_USE(T) { }
     36 
     37 } // namespace TestInterfaceDocumentV8Internal
     38 
     39 static void installV8TestInterfaceDocumentTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
     40 {
     41     functionTemplate->ReadOnlyPrototype();
     42 
     43     v8::Local<v8::Signature> defaultSignature;
     44     defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfaceDocument", V8Document::domTemplate(isolate), V8TestInterfaceDocument::internalFieldCount,
     45         0, 0,
     46         0, 0,
     47         0, 0,
     48         isolate);
     49     v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
     50     v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();
     51 
     52     // Custom toString template
     53     functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
     54 }
     55 
     56 v8::Handle<v8::FunctionTemplate> V8TestInterfaceDocument::domTemplate(v8::Isolate* isolate)
     57 {
     58     return V8DOMConfiguration::domClassTemplate(isolate, const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), installV8TestInterfaceDocumentTemplate);
     59 }
     60 
     61 bool V8TestInterfaceDocument::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
     62 {
     63     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
     64 }
     65 
     66 v8::Handle<v8::Object> V8TestInterfaceDocument::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
     67 {
     68     return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
     69 }
     70 
     71 TestInterfaceDocument* V8TestInterfaceDocument::toImplWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
     72 {
     73     return hasInstance(value, isolate) ? blink::toScriptWrappableBase(v8::Handle<v8::Object>::Cast(value))->toImpl<TestInterfaceDocument>() : 0;
     74 }
     75 
     76 EventTarget* V8TestInterfaceDocument::toEventTarget(v8::Handle<v8::Object> object)
     77 {
     78     return toImpl(object);
     79 }
     80 
     81 
     82 void V8TestInterfaceDocument::refObject(ScriptWrappableBase* internalPointer)
     83 {
     84 #if !ENABLE(OILPAN)
     85     internalPointer->toImpl<TestInterfaceDocument>()->ref();
     86 #endif
     87 }
     88 
     89 void V8TestInterfaceDocument::derefObject(ScriptWrappableBase* internalPointer)
     90 {
     91 #if !ENABLE(OILPAN)
     92     internalPointer->toImpl<TestInterfaceDocument>()->deref();
     93 #endif
     94 }
     95 
     96 WrapperPersistentNode* V8TestInterfaceDocument::createPersistentHandle(ScriptWrappableBase* internalPointer)
     97 {
     98 #if ENABLE(OILPAN)
     99     return WrapperPersistent<TestInterfaceDocument>::create(internalPointer->toImpl<TestInterfaceDocument>());
    100 #else
    101     ASSERT_NOT_REACHED();
    102     return 0;
    103 #endif
    104 }
    105 
    106 template<>
    107 v8::Handle<v8::Value> toV8NoInline(TestInterfaceDocument* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
    108 {
    109     return toV8(impl, creationContext, isolate);
    110 }
    111 
    112 } // namespace blink
    113