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 V8TestInterface_h
8 #define V8TestInterface_h
11 #include "V8TestInterfaceEmpty.h"
12 #include "bindings/tests/idls/TestInterfaceImplementation.h"
13 #include "bindings/v8/V8Binding.h"
14 #include "bindings/v8/V8DOMWrapper.h"
15 #include "bindings/v8/WrapperTypeInfo.h"
16 #include "platform/heap/Handle.h"
20 class V8TestInterface {
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 TestInterfaceImplementation* toNative(v8::Handle<v8::Object> object)
27 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
29 static TestInterfaceImplementation* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
30 static const WrapperTypeInfo wrapperTypeInfo;
31 static void derefObject(void*);
32 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
33 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>);
34 static void implementsCustomVoidMethodMethodCustom(const v8::FunctionCallbackInfo<v8::Value>&);
35 static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&);
36 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
37 static inline void* toInternalPointer(TestInterfaceImplementation* impl)
39 return V8TestInterfaceEmpty::toInternalPointer(impl);
42 static inline TestInterfaceImplementation* fromInternalPointer(void* object)
44 return static_cast<TestInterfaceImplementation*>(V8TestInterfaceEmpty::fromInternalPointer(object));
46 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceImplementation*, v8::Isolate*);
47 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*);
52 class TestInterfaceImplementation;
53 v8::Handle<v8::Value> toV8(TestInterfaceImplementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
55 template<class CallbackInfo>
56 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
58 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
61 template<class CallbackInfo>
62 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
64 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
67 template<class CallbackInfo, class Wrappable>
68 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl, Wrappable*)
70 v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
73 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceImplementation> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
75 return toV8(impl.get(), creationContext, isolate);
78 template<class CallbackInfo>
79 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl)
81 v8SetReturnValue(callbackInfo, impl.get());
84 template<class CallbackInfo>
85 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl)
87 v8SetReturnValueForMainWorld(callbackInfo, impl.get());
90 template<class CallbackInfo, class Wrappable>
91 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl, Wrappable* wrappable)
93 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
97 #endif // ENABLE(CONDITION)
98 #endif // V8TestInterface_h