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 V8TestInterface3_h
8 #define V8TestInterface3_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/TestInterface3.h"
15 #include "platform/heap/Handle.h"
19 class V8TestInterface3 {
21 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
22 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
23 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
24 static TestInterface3* toNative(v8::Handle<v8::Object> object)
26 return fromInternalPointer(blink::toInternalPointer(object));
28 static TestInterface3* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
29 static const WrapperTypeInfo wrapperTypeInfo;
30 static void derefObject(ScriptWrappableBase* internalPointer);
31 static void visitDOMWrapper(ScriptWrappableBase* internalPointer, const v8::Persistent<v8::Object>&, v8::Isolate*);
32 static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Value>&);
33 static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
34 static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Boolean>&);
35 static void namedPropertyGetterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&);
36 static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
37 static void namedPropertyQueryCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer>&);
38 static void namedPropertyDeleterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean>&);
39 static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
40 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
41 static inline ScriptWrappableBase* toInternalPointer(TestInterface3* impl)
43 return reinterpret_cast<ScriptWrappableBase*>(static_cast<void*>(impl));
46 static inline TestInterface3* fromInternalPointer(ScriptWrappableBase* internalPointer)
48 return reinterpret_cast<TestInterface3*>(static_cast<void*>(internalPointer));
50 static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
51 static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
54 friend v8::Handle<v8::Object> wrap(TestInterface3*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
55 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface3>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
58 v8::Handle<v8::Object> wrap(TestInterface3* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
60 inline v8::Handle<v8::Value> toV8(TestInterface3* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
63 return v8::Null(isolate);
64 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface3>(impl, isolate);
65 if (!wrapper.IsEmpty())
67 return wrap(impl, creationContext, isolate);
70 template<typename CallbackInfo>
71 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterface3* impl)
73 if (UNLIKELY(!impl)) {
74 v8SetReturnValueNull(callbackInfo);
77 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterface3>(callbackInfo.GetReturnValue(), impl))
79 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
80 v8SetReturnValue(callbackInfo, wrapper);
83 template<typename CallbackInfo>
84 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterface3* impl)
86 ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
87 if (UNLIKELY(!impl)) {
88 v8SetReturnValueNull(callbackInfo);
91 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterface3>(callbackInfo.GetReturnValue(), impl))
93 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
94 v8SetReturnValue(callbackInfo, wrapper);
97 template<class CallbackInfo, class Wrappable>
98 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface3* impl, Wrappable* wrappable)
100 if (UNLIKELY(!impl)) {
101 v8SetReturnValueNull(callbackInfo);
104 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterface3>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
106 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
107 v8SetReturnValue(callbackInfo, wrapper);
110 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface3> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
112 return toV8(impl.get(), creationContext, isolate);
115 template<class CallbackInfo>
116 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl)
118 v8SetReturnValue(callbackInfo, impl.get());
121 template<class CallbackInfo>
122 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl)
124 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
127 template<class CallbackInfo, class Wrappable>
128 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl, Wrappable* wrappable)
130 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
134 #endif // V8TestInterface3_h