Upstream version 7.36.149.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/tests/idls/TestInterface3.h"
11 #include "bindings/v8/V8Binding.h"
12 #include "bindings/v8/V8DOMWrapper.h"
13 #include "bindings/v8/WrapperTypeInfo.h"
14 #include "platform/heap/Handle.h"
15
16 namespace WebCore {
17
18 class V8TestInterface3 {
19 public:
20     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
21     static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
22     static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
23     static TestInterface3* toNative(v8::Handle<v8::Object> object)
24     {
25         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
26     }
27     static TestInterface3* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
28     static const WrapperTypeInfo wrapperTypeInfo;
29     static void derefObject(void*);
30     static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Isolate*);
31     static void indexedPropertyGetterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Value>&);
32     static void indexedPropertySetterCustom(uint32_t, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
33     static void indexedPropertyDeleterCustom(uint32_t, const v8::PropertyCallbackInfo<v8::Boolean>&);
34     static void namedPropertyGetterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>&);
35     static void namedPropertySetterCustom(v8::Local<v8::String>, v8::Local<v8::Value>, const v8::PropertyCallbackInfo<v8::Value>&);
36     static void namedPropertyQueryCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Integer>&);
37     static void namedPropertyDeleterCustom(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Boolean>&);
38     static void namedPropertyEnumeratorCustom(const v8::PropertyCallbackInfo<v8::Array>&);
39     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
40     static inline void* toInternalPointer(TestInterface3* impl)
41     {
42         return impl;
43     }
44
45     static inline TestInterface3* fromInternalPointer(void* object)
46     {
47         return static_cast<TestInterface3*>(object);
48     }
49     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterface3*, v8::Isolate*) { }
50     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
51
52 private:
53     friend v8::Handle<v8::Object> wrap(TestInterface3*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
54     static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterface3>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
55 };
56
57 inline v8::Handle<v8::Object> wrap(TestInterface3* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
58 {
59     ASSERT(impl);
60     ASSERT(!DOMDataStore::containsWrapper<V8TestInterface3>(impl, isolate));
61     return V8TestInterface3::createWrapper(impl, creationContext, isolate);
62 }
63
64 inline v8::Handle<v8::Value> toV8(TestInterface3* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
65 {
66     if (UNLIKELY(!impl))
67         return v8::Null(isolate);
68     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterface3>(impl, isolate);
69     if (!wrapper.IsEmpty())
70         return wrapper;
71     return wrap(impl, creationContext, isolate);
72 }
73
74 template<typename CallbackInfo>
75 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterface3* impl)
76 {
77     if (UNLIKELY(!impl)) {
78         v8SetReturnValueNull(callbackInfo);
79         return;
80     }
81     if (DOMDataStore::setReturnValueFromWrapper<V8TestInterface3>(callbackInfo.GetReturnValue(), impl))
82         return;
83     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
84     v8SetReturnValue(callbackInfo, wrapper);
85 }
86
87 template<typename CallbackInfo>
88 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterface3* impl)
89 {
90     ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
91     if (UNLIKELY(!impl)) {
92         v8SetReturnValueNull(callbackInfo);
93         return;
94     }
95     if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterface3>(callbackInfo.GetReturnValue(), impl))
96         return;
97     v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
98     v8SetReturnValue(callbackInfo, wrapper);
99 }
100
101 template<class CallbackInfo, class Wrappable>
102 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface3* impl, Wrappable* wrappable)
103 {
104     if (UNLIKELY(!impl)) {
105         v8SetReturnValueNull(callbackInfo);
106         return;
107     }
108     if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterface3>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
109         return;
110     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
111     v8SetReturnValue(callbackInfo, wrapper);
112 }
113
114 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterface3> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
115 {
116     return toV8(impl.get(), creationContext, isolate);
117 }
118
119 template<class CallbackInfo>
120 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl)
121 {
122     v8SetReturnValue(callbackInfo, impl.get());
123 }
124
125 template<class CallbackInfo>
126 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl)
127 {
128     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
129 }
130
131 template<class CallbackInfo, class Wrappable>
132 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<TestInterface3> impl, Wrappable* wrappable)
133 {
134     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
135 }
136
137 }
138 #endif // V8TestInterface3_h