Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestInterfaceEventConstructor.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 V8TestInterfaceEventConstructor_h
8 #define V8TestInterfaceEventConstructor_h
9
10 #include "V8Event.h"
11 #include "bindings/tests/idls/TestInterfaceEventConstructor.h"
12 #include "bindings/v8/V8Binding.h"
13 #include "bindings/v8/V8DOMWrapper.h"
14 #include "bindings/v8/WrapperTypeInfo.h"
15 #include "platform/heap/Handle.h"
16
17 namespace WebCore {
18
19 class Dictionary;
20 class V8TestInterfaceEventConstructor {
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 TestInterfaceEventConstructor* toNative(v8::Handle<v8::Object> object)
26     {
27         return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex));
28     }
29     static TestInterfaceEventConstructor* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
30     static const WrapperTypeInfo wrapperTypeInfo;
31     static void derefObject(void*);
32     static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
33     static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + 0;
34     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 1;
35     static inline void* toInternalPointer(TestInterfaceEventConstructor* impl)
36     {
37         return V8Event::toInternalPointer(impl);
38     }
39
40     static inline TestInterfaceEventConstructor* fromInternalPointer(void* object)
41     {
42         return static_cast<TestInterfaceEventConstructor*>(V8Event::fromInternalPointer(object));
43     }
44     static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestInterfaceEventConstructor*, v8::Isolate*) { }
45     static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
46
47 private:
48     friend v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
49     static v8::Handle<v8::Object> createWrapper(PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
50 };
51
52 inline v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
53 {
54     ASSERT(impl);
55     ASSERT(!DOMDataStore::containsWrapper<V8TestInterfaceEventConstructor>(impl, isolate));
56     return V8TestInterfaceEventConstructor::createWrapper(impl, creationContext, isolate);
57 }
58
59 inline v8::Handle<v8::Value> toV8(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
60 {
61     if (UNLIKELY(!impl))
62         return v8::Null(isolate);
63     v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfaceEventConstructor>(impl, isolate);
64     if (!wrapper.IsEmpty())
65         return wrapper;
66     return wrap(impl, creationContext, isolate);
67 }
68
69 template<typename CallbackInfo>
70 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl)
71 {
72     if (UNLIKELY(!impl)) {
73         v8SetReturnValueNull(callbackInfo);
74         return;
75     }
76     if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl))
77         return;
78     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
79     v8SetReturnValue(callbackInfo, wrapper);
80 }
81
82 template<typename CallbackInfo>
83 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl)
84 {
85     ASSERT(DOMWrapperWorld::current(callbackInfo.GetIsolate()).isMainWorld());
86     if (UNLIKELY(!impl)) {
87         v8SetReturnValueNull(callbackInfo);
88         return;
89     }
90     if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl))
91         return;
92     v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
93     v8SetReturnValue(callbackInfo, wrapper);
94 }
95
96 template<class CallbackInfo, class Wrappable>
97 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterfaceEventConstructor* impl, Wrappable* wrappable)
98 {
99     if (UNLIKELY(!impl)) {
100         v8SetReturnValueNull(callbackInfo);
101         return;
102     }
103     if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfaceEventConstructor>(callbackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable))
104         return;
105     v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackInfo.GetIsolate());
106     v8SetReturnValue(callbackInfo, wrapper);
107 }
108
109 inline v8::Handle<v8::Value> toV8(PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
110 {
111     return toV8(impl.get(), creationContext, isolate);
112 }
113
114 template<class CallbackInfo>
115 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl)
116 {
117     v8SetReturnValue(callbackInfo, impl.get());
118 }
119
120 template<class CallbackInfo>
121 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl)
122 {
123     v8SetReturnValueForMainWorld(callbackInfo, impl.get());
124 }
125
126 template<class CallbackInfo, class Wrappable>
127 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor> impl, Wrappable* wrappable)
128 {
129     v8SetReturnValueFast(callbackInfo, impl.get(), wrappable);
130 }
131
132 bool initializeTestInterfaceEventConstructor(TestInterfaceEventConstructorInit&, const Dictionary&, ExceptionState&, const v8::FunctionCallbackInfo<v8::Value>& info, const String& = "");
133
134 }
135 #endif // V8TestInterfaceEventConstructor_h