Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestInterface.h
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 #ifndef V8TestInterface_h
8 #define V8TestInterface_h
9
10 #if ENABLE(CONDITION)
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"
17
18 namespace WebCore {
19
20 class V8TestInterface {
21 public:
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)
26     {
27         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
28     }
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)
38     {
39         return V8TestInterfaceEmpty::toInternalPointer(impl);
40     }
41
42     static inline TestInterfaceImplementation* fromInternalPointer(void* object)
43     {
44         return static_cast<TestInterfaceImplementation*>(V8TestInterfaceEmpty::fromInternalPointer(object));
45     }
46     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceImplementation*, v8::Isolate*);
47     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*);
48
49 private:
50 };
51
52 class TestInterfaceImplementation;
53 v8::Handle<v8::Value> toV8(TestInterfaceImplementation*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
54
55 template<class CallbackInfo>
56 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
57 {
58     v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
59 }
60
61 template<class CallbackInfo>
62 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl)
63 {
64      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
65 }
66
67 template<class CallbackInfo, class Wrappable>
68 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceImplementation* impl, Wrappable*)
69 {
70      v8SetReturnValue(callbackInfo, toV8(impl, callbackInfo.Holder(), callbackInfo.GetIsolate()));
71 }
72
73 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfaceImplementation> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
74 {
75     return toV8(impl.get(), creationContext, isolate);
76 }
77
78 template<class CallbackInfo>
79 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl)
80 {
81     v8SetReturnValue(callbackInfo, impl.get());
82 }
83
84 template<class CallbackInfo>
85 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl)
86 {
87     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
88 }
89
90 template<class CallbackInfo, class Wrappable>
91 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterfaceImplementation> impl, Wrappable* wrappable)
92 {
93     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
94 }
95
96 }
97 #endif // ENABLE(CONDITION)
98 #endif // V8TestInterface_h