Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestInterface3.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 V8TestInterface3_h
8 #define V8TestInterface3_h
9
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"
16
17 namespace blink {
18
19 class V8TestInterface3 {
20 public:
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)
25     {
26         return fromInternalPointer(blink::toInternalPointer(object));
27     }
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)
42     {
43         return reinterpret_cast<ScriptWrappableBase*>(static_cast<void*>(impl));
44     }
45
46     static inline TestInterface3* fromInternalPointer(ScriptWrappableBase* internalPointer)
47     {
48         return reinterpret_cast<TestInterface3*>(static_cast<void*>(internalPointer));
49     }
50     static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
51     static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
52
53 private:
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*);
56 };
57
58 v8::Handle<v8::Object> wrap(TestInterface3* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
59
60 inline v8::Handle<v8::Value> toV8(TestInterface3* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
61 {
62     if (UNLIKELY(!impl))
63         return v8::Null(isolate);
64     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface3>(impl, isolate);
65     if (!wrapper.IsEmpty())
66         return wrapper;
67     return wrap(impl, creationContext, isolate);
68 }
69
70 template<typename CallbackInfo>
71 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterface3* impl)
72 {
73     if (UNLIKELY(!impl)) {
74         v8SetReturnValueNull(callbackInfo);
75         return;
76     }
77     if (DOMDataStore::setReturnValueFromWrapper<V8TestInterface3>(callbackInfo.GetReturnValue(), impl))
78         return;
79     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
80     v8SetReturnValue(callbackInfo, wrapper);
81 }
82
83 template<typename CallbackInfo>
84 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterface3* impl)
85 {
86     ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
87     if (UNLIKELY(!impl)) {
88         v8SetReturnValueNull(callbackInfo);
89         return;
90     }
91     if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterface3>(callbackInfo.GetReturnValue(), impl))
92         return;
93     v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
94     v8SetReturnValue(callbackInfo, wrapper);
95 }
96
97 template<class CallbackInfo, class Wrappable>
98 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface3* impl, Wrappable* wrappable)
99 {
100     if (UNLIKELY(!impl)) {
101         v8SetReturnValueNull(callbackInfo);
102         return;
103     }
104     if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterface3>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
105         return;
106     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
107     v8SetReturnValue(callbackInfo, wrapper);
108 }
109
110 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface3> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
111 {
112     return toV8(impl.get(), creationContext, isolate);
113 }
114
115 template<class CallbackInfo>
116 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl)
117 {
118     v8SetReturnValue(callbackInfo, impl.get());
119 }
120
121 template<class CallbackInfo>
122 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl)
123 {
124     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
125 }
126
127 template<class CallbackInfo, class Wrappable>
128 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl, Wrappable* wrappable)
129 {
130     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
131 }
132
133 }
134 #endif // V8TestInterface3_h