OLD | NEW |
| (Empty) |
1 /* | |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | |
3 * | |
4 * Redistribution and use in source and binary forms, with or without | |
5 * modification, are permitted provided that the following conditions are | |
6 * met: | |
7 * | |
8 * * Redistributions of source code must retain the above copyright | |
9 * notice, this list of conditions and the following disclaimer. | |
10 * * Redistributions in binary form must reproduce the above | |
11 * copyright notice, this list of conditions and the following disclaimer | |
12 * in the documentation and/or other materials provided with the | |
13 * distribution. | |
14 * * Neither the name of Google Inc. nor the names of its | |
15 * contributors may be used to endorse or promote products derived from | |
16 * this software without specific prior written permission. | |
17 * | |
18 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
19 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | |
20 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | |
21 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | |
22 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
29 */ | |
30 | |
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | |
32 | |
33 #ifndef V8TestInterfacePython4_h | |
34 #define V8TestInterfacePython4_h | |
35 | |
36 #include "bindings/tests/idls/TestInterfacePython4.h" | |
37 #include "bindings/v8/V8Binding.h" | |
38 #include "bindings/v8/V8DOMWrapper.h" | |
39 #include "bindings/v8/WrapperTypeInfo.h" | |
40 #include "heap/Handle.h" | |
41 | |
42 namespace WebCore { | |
43 | |
44 class V8TestInterfacePython4 { | |
45 public: | |
46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*); | |
47 static v8::Handle<v8::Object> findInstanceInPrototypeChain(v8::Handle<v8::Va
lue>, v8::Isolate*); | |
48 static v8::Handle<v8::FunctionTemplate> domTemplate(v8::Isolate*, WrapperWor
ldType); | |
49 static TestInterfacePython4* toNative(v8::Handle<v8::Object> object) | |
50 { | |
51 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | |
52 } | |
53 static TestInterfacePython4* toNativeWithTypeCheck(v8::Isolate*, v8::Handle<
v8::Value>); | |
54 static const WrapperTypeInfo wrapperTypeInfo; | |
55 static void derefObject(void*); | |
56 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is
olate*); | |
57 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | |
58 static inline void* toInternalPointer(TestInterfacePython4* impl) | |
59 { | |
60 return impl; | |
61 } | |
62 | |
63 static inline TestInterfacePython4* fromInternalPointer(void* object) | |
64 { | |
65 return static_cast<TestInterfacePython4*>(object); | |
66 } | |
67 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfacePython4*, v8::Isolate*) { } | |
68 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | |
69 | |
70 private: | |
71 friend v8::Handle<v8::Object> wrap(TestInterfacePython4*, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate*); | |
72 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfacePython4>
, v8::Handle<v8::Object> creationContext, v8::Isolate*); | |
73 }; | |
74 | |
75 inline v8::Handle<v8::Object> wrap(TestInterfacePython4* impl, v8::Handle<v8::Ob
ject> creationContext, v8::Isolate* isolate) | |
76 { | |
77 ASSERT(impl); | |
78 ASSERT(!DOMDataStore::containsWrapper<V8TestInterfacePython4>(impl, isolate)
); | |
79 return V8TestInterfacePython4::createWrapper(impl, creationContext, isolate)
; | |
80 } | |
81 | |
82 inline v8::Handle<v8::Value> toV8(TestInterfacePython4* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | |
83 { | |
84 if (UNLIKELY(!impl)) | |
85 return v8::Null(isolate); | |
86 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfacePyth
on4>(impl, isolate); | |
87 if (!wrapper.IsEmpty()) | |
88 return wrapper; | |
89 return wrap(impl, creationContext, isolate); | |
90 } | |
91 | |
92 template<typename CallbackInfo> | |
93 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfacePyth
on4* impl) | |
94 { | |
95 if (UNLIKELY(!impl)) { | |
96 v8SetReturnValueNull(callbackInfo); | |
97 return; | |
98 } | |
99 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfacePython4>(callback
Info.GetReturnValue(), impl)) | |
100 return; | |
101 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | |
102 v8SetReturnValue(callbackInfo, wrapper); | |
103 } | |
104 | |
105 template<typename CallbackInfo> | |
106 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfacePython4* impl) | |
107 { | |
108 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | |
109 if (UNLIKELY(!impl)) { | |
110 v8SetReturnValueNull(callbackInfo); | |
111 return; | |
112 } | |
113 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfacePytho
n4>(callbackInfo.GetReturnValue(), impl)) | |
114 return; | |
115 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | |
116 v8SetReturnValue(callbackInfo, wrapper); | |
117 } | |
118 | |
119 template<class CallbackInfo, class Wrappable> | |
120 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
Python4* impl, Wrappable* wrappable) | |
121 { | |
122 if (UNLIKELY(!impl)) { | |
123 v8SetReturnValueNull(callbackInfo); | |
124 return; | |
125 } | |
126 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfacePython4>(call
backInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | |
127 return; | |
128 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | |
129 v8SetReturnValue(callbackInfo, wrapper); | |
130 } | |
131 | |
132 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfacePython4> impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | |
133 { | |
134 return toV8(impl.get(), creationContext, isolate); | |
135 } | |
136 | |
137 template<class CallbackInfo> | |
138 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfacePython4> impl) | |
139 { | |
140 v8SetReturnValue(callbackInfo, impl.get()); | |
141 } | |
142 | |
143 template<class CallbackInfo> | |
144 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfacePython4> impl) | |
145 { | |
146 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | |
147 } | |
148 | |
149 template<class CallbackInfo, class Wrappable> | |
150 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfacePython4> impl, Wrappable* wrappable) | |
151 { | |
152 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | |
153 } | |
154 | |
155 } | |
156 #endif // V8TestInterfacePython4_h | |
OLD | NEW |