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 V8TestInterfaceEventConstructor_h
8 #define V8TestInterfaceEventConstructor_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/TestInterfaceEventConstructor.h"
15 #include "bindings/tests/v8/V8Event.h"
16 #include "platform/heap/Handle.h"
21 class V8TestInterfaceEventConstructor {
23 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
24 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
25 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
26 static TestInterfaceEventConstructor* toNative(v8::Handle<v8::Object> object)
28 return fromInternalPointer(blink::toInternalPointer(object));
30 static TestInterfaceEventConstructor* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
31 static const WrapperTypeInfo wrapperTypeInfo;
32 static void derefObject(ScriptWrappableBase* internalPointer);
33 static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
35 static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + 0;
36 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 + 1;
38 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
40 static inline ScriptWrappableBase* toInternalPointer(TestInterfaceEventConstructor* impl)
42 return V8Event::toInternalPointer(impl);
45 static inline TestInterfaceEventConstructor* fromInternalPointer(ScriptWrappableBase* internalPointer)
47 return static_cast<TestInterfaceEventConstructor*>(V8Event::fromInternalPointer(internalPointer));
49 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
50 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
53 friend v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
54 static v8::Handle<v8::Object> createWrapper(PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
57 v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
59 inline v8::Handle<v8::Value> toV8(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
62 return v8::Null(isolate);
63 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceEventConstructor>(impl, isolate);
64 if (!wrapper.IsEmpty())
66 return wrap(impl, creationContext, isolate);
69 template<typename CallbackInfo>
70 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl)
72 if (UNLIKELY(!impl)) {
73 v8SetReturnValueNull(callbackInfo);
76 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl))
78 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
79 v8SetReturnValue(callbackInfo, wrapper);
82 template<typename CallbackInfo>
83 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl)
85 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
86 if (UNLIKELY(!impl)) {
87 v8SetReturnValueNull(callbackInfo);
90 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl))
92 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
93 v8SetReturnValue(callbackInfo, wrapper);
96 template<class CallbackInfo, class Wrappable>
97 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl, Wrappable* wrappable)
99 if (UNLIKELY(!impl)) {
100 v8SetReturnValueNull(callbackInfo);
103 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
105 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
106 v8SetReturnValue(callbackInfo, wrapper);
109 inline v8::Handle<v8::Value> toV8(PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
111 return toV8(impl.get(), creationContext, isolate);
114 template<class CallbackInfo>
115 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl)
117 v8SetReturnValue(callbackInfo, impl.get());
120 template<class CallbackInfo>
121 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl)
123 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
126 template<class CallbackInfo, class Wrappable>
127 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl, Wrappable* wrappable)
129 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
132 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = "");
135 #endif // V8TestInterfaceEventConstructor_h