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!
7 #ifndef V8TestInterfaceDocument_h
8 #define V8TestInterfaceDocument_h
10 #include "bindings/core/v8/ScriptWrappable.h"
11 #include "bindings/core/v8/V8Binding.h"
12 #include "bindings/core/v8/V8DOMWrapper.h"
13 #include "bindings/core/v8/WrapperTypeInfo.h"
14 #include "bindings/tests/idls/TestInterfaceDocument.h"
15 #include "bindings/tests/v8/V8Document.h"
16 #include "platform/heap/Handle.h"
20 class V8TestInterfaceDocument {
22 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
23 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
24 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
25 static TestInterfaceDocument* toNative(v8::Handle<v8::Object> object)
27 return fromInternalPointer(blink::toInternalPointer(object));
29 static TestInterfaceDocument* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
30 static const WrapperTypeInfo wrapperTypeInfo;
31 static void derefObject(ScriptWrappableBase* internalPointer);
32 static EventTarget* toEventTarget(v8::Handle<v8::Object>);
34 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + 0;
35 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 + 1;
37 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
39 static inline ScriptWrappableBase* toInternalPointer(TestInterfaceDocument* impl)
41 return V8Document::toInternalPointer(impl);
44 static inline TestInterfaceDocument* fromInternalPointer(ScriptWrappableBase* internalPointer)
46 return static_cast<TestInterfaceDocument*>(V8Document::fromInternalPointer(internalPointer));
48 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
49 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
52 friend v8::Handle<v8::Object> wrap(TestInterfaceDocument*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
53 static v8::Handle<v8::Object> createWrapper(PassRefPtrWillBeRawPtr<TestInterfaceDocument>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
56 v8::Handle<v8::Object> wrap(TestInterfaceDocument* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
58 inline v8::Handle<v8::Value> toV8(TestInterfaceDocument* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
61 return v8::Null(isolate);
62 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceDocument>(impl, isolate);
63 if (!wrapper.IsEmpty())
65 return wrap(impl, creationContext, isolate);
68 template<typename CallbackInfo>
69 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceDocument* impl)
71 if (UNLIKELY(!impl)) {
72 v8SetReturnValueNull(callbackInfo);
75 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceDocument>(callbackInfo.GetReturnValue(), impl))
77 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
78 v8SetReturnValue(callbackInfo, wrapper);
81 template<typename CallbackInfo>
82 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceDocument* impl)
84 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
85 if (UNLIKELY(!impl)) {
86 v8SetReturnValueNull(callbackInfo);
89 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceDocument>(callbackInfo.GetReturnValue(), impl))
91 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
92 v8SetReturnValue(callbackInfo, wrapper);
95 template<class CallbackInfo, class Wrappable>
96 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceDocument* impl, Wrappable* wrappable)
98 if (UNLIKELY(!impl)) {
99 v8SetReturnValueNull(callbackInfo);
102 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceDocument>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
104 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
105 v8SetReturnValue(callbackInfo, wrapper);
108 inline v8::Handle<v8::Value> toV8(PassRefPtrWillBeRawPtr<TestInterfaceDocument> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
110 return toV8(impl.get(), creationContext, isolate);
113 template<class CallbackInfo>
114 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceDocument> impl)
116 v8SetReturnValue(callbackInfo, impl.get());
119 template<class CallbackInfo>
120 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceDocument> impl)
122 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
125 template<class CallbackInfo, class Wrappable>
126 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceDocument> impl, Wrappable* wrappable)
128 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
132 #endif // V8TestInterfaceDocument_h