OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 12 matching lines...) Expand all Loading... |
23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | 23 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 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. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! | 31 // This file has been auto-generated by code_generator_v8.pm. DO NOT MODIFY! |
32 | 32 |
33 #ifndef V8TestActiveDOMObject_h | 33 #ifndef V8TestInterfacePython_h |
34 #define V8TestActiveDOMObject_h | 34 #define V8TestInterfacePython_h |
35 | 35 |
36 #include "bindings/tests/idls/TestActiveDOMObject.h" | 36 #if ENABLE(CONDITION) |
| 37 #include "bindings/tests/idls/TestInterfacePython.h" |
37 #include "bindings/v8/V8Binding.h" | 38 #include "bindings/v8/V8Binding.h" |
38 #include "bindings/v8/V8DOMWrapper.h" | 39 #include "bindings/v8/V8DOMWrapper.h" |
39 #include "bindings/v8/WrapperTypeInfo.h" | 40 #include "bindings/v8/WrapperTypeInfo.h" |
40 | 41 |
41 namespace WebCore { | 42 namespace WebCore { |
42 | 43 |
43 class V8TestActiveDOMObject { | 44 class V8TestInterfacePython { |
44 public: | 45 public: |
45 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); | 46 static bool hasInstance(v8::Handle<v8::Value>, v8::Isolate*, WrapperWorldTyp
e); |
46 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); | 47 static bool hasInstanceInAnyWorld(v8::Handle<v8::Value>, v8::Isolate*); |
47 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); | 48 static v8::Handle<v8::FunctionTemplate> GetTemplate(v8::Isolate*, WrapperWor
ldType); |
48 static TestActiveDOMObject* toNative(v8::Handle<v8::Object> object) | 49 static TestInterfacePython* toNative(v8::Handle<v8::Object> object) |
49 { | 50 { |
50 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); | 51 return fromInternalPointer(object->GetAlignedPointerFromInternalField(v8
DOMWrapperObjectIndex)); |
51 } | 52 } |
52 static void derefObject(void*); | 53 static void derefObject(void*); |
53 static const WrapperTypeInfo wrapperTypeInfo; | 54 static const WrapperTypeInfo wrapperTypeInfo; |
| 55 static void visitDOMWrapper(void*, const v8::Persistent<v8::Object>&, v8::Is
olate*); |
| 56 static ActiveDOMObject* toActiveDOMObject(v8::Handle<v8::Object>); |
| 57 static void legacyCallCustom(const v8::FunctionCallbackInfo<v8::Value>&); |
54 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; | 58 static const int internalFieldCount = v8DefaultWrapperInternalFieldCount + 0
; |
55 static inline void* toInternalPointer(TestActiveDOMObject* impl) | 59 static inline void* toInternalPointer(TestInterfacePython* impl) |
56 { | 60 { |
57 return impl; | 61 return impl; |
58 } | 62 } |
59 | 63 |
60 static inline TestActiveDOMObject* fromInternalPointer(void* object) | 64 static inline TestInterfacePython* fromInternalPointer(void* object) |
61 { | 65 { |
62 return static_cast<TestActiveDOMObject*>(object); | 66 return static_cast<TestInterfacePython*>(object); |
63 } | 67 } |
64 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestA
ctiveDOMObject*, v8::Isolate*) { } | 68 static void installPerContextEnabledProperties(v8::Handle<v8::Object>, TestI
nterfacePython*, v8::Isolate*) { } |
65 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } | 69 static void installPerContextEnabledMethods(v8::Handle<v8::Object>, v8::Isol
ate*) { } |
66 | 70 |
67 private: | 71 private: |
68 friend v8::Handle<v8::Object> wrap(TestActiveDOMObject*, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate*); | 72 friend v8::Handle<v8::Object> wrap(TestInterfacePython*, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate*); |
69 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestActiveDOMObject>,
v8::Handle<v8::Object> creationContext, v8::Isolate*); | 73 static v8::Handle<v8::Object> createWrapper(PassRefPtr<TestInterfacePython>,
v8::Handle<v8::Object> creationContext, v8::Isolate*); |
70 }; | 74 }; |
71 | 75 |
72 template<> | 76 template<> |
73 class WrapperTypeTraits<TestActiveDOMObject > { | 77 class WrapperTypeTraits<TestInterfacePython > { |
74 public: | 78 public: |
75 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestActiveDOMObj
ect::wrapperTypeInfo; } | 79 static const WrapperTypeInfo* wrapperTypeInfo() { return &V8TestInterfacePyt
hon::wrapperTypeInfo; } |
76 }; | 80 }; |
77 | 81 |
78 inline v8::Handle<v8::Object> wrap(TestActiveDOMObject* impl, v8::Handle<v8::Obj
ect> creationContext, v8::Isolate* isolate) | 82 v8::Handle<v8::Object> wrap(TestInterfacePython* impl, v8::Handle<v8::Object> cr
eationContext, v8::Isolate*); |
79 { | |
80 ASSERT(impl); | |
81 ASSERT(!DOMDataStore::containsWrapper<V8TestActiveDOMObject>(impl, isolate))
; | |
82 return V8TestActiveDOMObject::createWrapper(impl, creationContext, isolate); | |
83 } | |
84 | 83 |
85 inline v8::Handle<v8::Value> toV8(TestActiveDOMObject* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) | 84 inline v8::Handle<v8::Value> toV8(TestInterfacePython* impl, v8::Handle<v8::Obje
ct> creationContext, v8::Isolate* isolate) |
86 { | 85 { |
87 if (UNLIKELY(!impl)) | 86 if (UNLIKELY(!impl)) |
88 return v8::Null(isolate); | 87 return v8::Null(isolate); |
89 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestActiveDOMObje
ct>(impl, isolate); | 88 v8::Handle<v8::Value> wrapper = DOMDataStore::getWrapper<V8TestInterfacePyth
on>(impl, isolate); |
90 if (!wrapper.IsEmpty()) | 89 if (!wrapper.IsEmpty()) |
91 return wrapper; | 90 return wrapper; |
92 return wrap(impl, creationContext, isolate); | 91 return wrap(impl, creationContext, isolate); |
93 } | 92 } |
94 | 93 |
95 template<typename CallbackInfo> | 94 template<typename CallbackInfo> |
96 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestActiveDOMObje
ct* impl) | 95 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, TestInterfacePyth
on* impl) |
97 { | 96 { |
98 if (UNLIKELY(!impl)) { | 97 if (UNLIKELY(!impl)) { |
99 v8SetReturnValueNull(callbackInfo); | 98 v8SetReturnValueNull(callbackInfo); |
100 return; | 99 return; |
101 } | 100 } |
102 if (DOMDataStore::setReturnValueFromWrapper<V8TestActiveDOMObject>(callbackI
nfo.GetReturnValue(), impl)) | 101 if (DOMDataStore::setReturnValueFromWrapper<V8TestInterfacePython>(callbackI
nfo.GetReturnValue(), impl)) |
103 return; | 102 return; |
104 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 103 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
105 v8SetReturnValue(callbackInfo, wrapper); | 104 v8SetReturnValue(callbackInfo, wrapper); |
106 } | 105 } |
107 | 106 |
108 template<typename CallbackInfo> | 107 template<typename CallbackInfo> |
109 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestA
ctiveDOMObject* impl) | 108 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, TestI
nterfacePython* impl) |
110 { | 109 { |
111 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); | 110 ASSERT(worldType(callbackInfo.GetIsolate()) == MainWorld); |
112 if (UNLIKELY(!impl)) { | 111 if (UNLIKELY(!impl)) { |
113 v8SetReturnValueNull(callbackInfo); | 112 v8SetReturnValueNull(callbackInfo); |
114 return; | 113 return; |
115 } | 114 } |
116 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestActiveDOMObjec
t>(callbackInfo.GetReturnValue(), impl)) | 115 if (DOMDataStore::setReturnValueFromWrapperForMainWorld<V8TestInterfacePytho
n>(callbackInfo.GetReturnValue(), impl)) |
117 return; | 116 return; |
118 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); | 117 v8::Handle<v8::Value> wrapper = wrap(impl, callbackInfo.Holder(), callbackIn
fo.GetIsolate()); |
119 v8SetReturnValue(callbackInfo, wrapper); | 118 v8SetReturnValue(callbackInfo, wrapper); |
120 } | 119 } |
121 | 120 |
122 template<class CallbackInfo, class Wrappable> | 121 template<class CallbackInfo, class Wrappable> |
123 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestActiveDOM
Object* impl, Wrappable* wrappable) | 122 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, TestInterface
Python* impl, Wrappable* wrappable) |
124 { | 123 { |
125 if (UNLIKELY(!impl)) { | 124 if (UNLIKELY(!impl)) { |
126 v8SetReturnValueNull(callbackInfo); | 125 v8SetReturnValueNull(callbackInfo); |
127 return; | 126 return; |
128 } | 127 } |
129 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestActiveDOMObject>(callb
ackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) | 128 if (DOMDataStore::setReturnValueFromWrapperFast<V8TestInterfacePython>(callb
ackInfo.GetReturnValue(), impl, callbackInfo.Holder(), wrappable)) |
130 return; | 129 return; |
131 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); | 130 v8::Handle<v8::Object> wrapper = wrap(impl, callbackInfo.Holder(), callbackI
nfo.GetIsolate()); |
132 v8SetReturnValue(callbackInfo, wrapper); | 131 v8SetReturnValue(callbackInfo, wrapper); |
133 } | 132 } |
134 | 133 |
135 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestActiveDOMObject > impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) | 134 inline v8::Handle<v8::Value> toV8(PassRefPtr<TestInterfacePython > impl, v8::Han
dle<v8::Object> creationContext, v8::Isolate* isolate) |
136 { | 135 { |
137 return toV8(impl.get(), creationContext, isolate); | 136 return toV8(impl.get(), creationContext, isolate); |
138 } | 137 } |
139 | 138 |
140 template<class CallbackInfo> | 139 template<class CallbackInfo> |
141 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestAc
tiveDOMObject > impl) | 140 inline void v8SetReturnValue(const CallbackInfo& callbackInfo, PassRefPtr<TestIn
terfacePython > impl) |
142 { | 141 { |
143 v8SetReturnValue(callbackInfo, impl.get()); | 142 v8SetReturnValue(callbackInfo, impl.get()); |
144 } | 143 } |
145 | 144 |
146 template<class CallbackInfo> | 145 template<class CallbackInfo> |
147 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestActiveDOMObject > impl) | 146 inline void v8SetReturnValueForMainWorld(const CallbackInfo& callbackInfo, PassR
efPtr<TestInterfacePython > impl) |
148 { | 147 { |
149 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); | 148 v8SetReturnValueForMainWorld(callbackInfo, impl.get()); |
150 } | 149 } |
151 | 150 |
152 template<class CallbackInfo, class Wrappable> | 151 template<class CallbackInfo, class Wrappable> |
153 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stActiveDOMObject > impl, Wrappable* wrappable) | 152 inline void v8SetReturnValueFast(const CallbackInfo& callbackInfo, PassRefPtr<Te
stInterfacePython > impl, Wrappable* wrappable) |
154 { | 153 { |
155 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); | 154 v8SetReturnValueFast(callbackInfo, impl.get(), wrappable); |
156 } | 155 } |
157 | 156 |
158 } | 157 } |
159 | 158 #endif // ENABLE(CONDITION) |
160 #endif // V8TestActiveDOMObject_h | 159 #endif // V8TestInterfacePython_h |
OLD | NEW |