Upstream version 10.38.222.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 "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/TestInterfaceEventConstructor.h"
15 #include "bindings/tests/v8/V8Event.h"
16 #include "platform/heap/Handle.h"
17
18 namespace blink {
19
20 class Dictionary;
21 class V8TestInterfaceEventConstructor {
22 public:
23     static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*);
24     static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Value>, v8::Isolate*);
25     static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*);
26     static TestInterfaceEventConstructor* toNative(v8::Handle<v8::Object> object)
27     {
28         return fromInternalPointer(blink::toInternalPointer(object));
29     }
30     static TestInterfaceEventConstructor* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<v8::Value>);
31     static const WrapperTypeInfo wrapperTypeInfo;
32     static void derefObject(ScriptWrappableBase* internalPointer);
33     static void constructorCallback(const v8::FunctionCallbackInfo<v8::Value>&);
34 #if ENABLE(OILPAN)
35     static const int persistentHandleIndex = v8DefaultWrapperInternalFieldCount + 0;
36     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0 + 1;
37 #else
38     static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0;
39 #endif
40     static inline ScriptWrappableBase* toInternalPointer(TestInterfaceEventConstructor* impl)
41     {
42         return V8Event::toInternalPointer(impl);
43     }
44
45     static inline TestInterfaceEventConstructor* fromInternalPointer(ScriptWrappableBase* internalPointer)
46     {
47         return static_cast<TestInterfaceEventConstructor*>(V8Event::fromInternalPointer(internalPointer));
48     }
49     static void installConditionallyEnabledProperties(v8::Handle<v8::Object>, v8::Isolate*) { }
50     static void installConditionallyEnabledMethods(v8::Handle<v8::Object>, v8::Isolate*) { }
51
52 private:
53     friend v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor*, v8::Handle<v8::Object> creationContext, v8::Isolate*);
54     static v8::Handle<v8::Object> createWrapper(PassRefPtrWillBeRawPtr<TestInterfaceEventConstructor>, v8::Handle<v8::Object> creationContext, v8::Isolate*);
55 };
56
57 v8::Handle<v8::Object> wrap(TestInterfaceEventConstructor* impl, v8::Handle<v8::Object> creationContext, v8::Isolate*);
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