OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |
6 | 6 |
7 #include "config.h" | 7 #include "config.h" |
8 #if ENABLE(CONDITION) | 8 #if ENABLE(Condition1) || ENABLE(Condition2) |
9 #include "V8TestInterface.h" | 9 #include "V8TestInterface.h" |
10 | 10 |
11 #include "RuntimeEnabledFeatures.h" | 11 #include "RuntimeEnabledFeatures.h" |
12 #include "V8Node.h" | 12 #include "V8Node.h" |
13 #include "V8TestImplementedAs.h" | 13 #include "V8NodeList.h" |
14 #include "V8TestInterfaceEmpty.h" | 14 #include "V8TestInterfaceEmpty.h" |
| 15 #include "V8TestObject.h" |
15 #include "bindings/tests/idls/TestImplements.h" | 16 #include "bindings/tests/idls/TestImplements.h" |
16 #include "bindings/tests/idls/TestImplements2Implementation.h" | |
17 #include "bindings/tests/idls/TestPartialInterface.h" | 17 #include "bindings/tests/idls/TestPartialInterface.h" |
18 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h" | |
19 #include "bindings/v8/ExceptionState.h" | 18 #include "bindings/v8/ExceptionState.h" |
20 #include "bindings/v8/ScriptValue.h" | |
21 #include "bindings/v8/V8AbstractEventListener.h" | 19 #include "bindings/v8/V8AbstractEventListener.h" |
22 #include "bindings/v8/V8DOMConfiguration.h" | 20 #include "bindings/v8/V8DOMConfiguration.h" |
23 #include "bindings/v8/V8EventListenerList.h" | 21 #include "bindings/v8/V8EventListenerList.h" |
24 #include "bindings/v8/V8HiddenValue.h" | 22 #include "bindings/v8/V8HiddenValue.h" |
25 #include "bindings/v8/V8ObjectConstructor.h" | 23 #include "bindings/v8/V8ObjectConstructor.h" |
26 #include "core/dom/ContextFeatures.h" | 24 #include "core/dom/ContextFeatures.h" |
27 #include "core/dom/Document.h" | 25 #include "core/dom/Document.h" |
| 26 #include "core/frame/DOMWindow.h" |
28 #include "platform/TraceEvent.h" | 27 #include "platform/TraceEvent.h" |
29 #include "wtf/GetPtr.h" | 28 #include "wtf/GetPtr.h" |
30 #include "wtf/RefPtr.h" | 29 #include "wtf/RefPtr.h" |
31 | 30 |
32 namespace WebCore { | 31 namespace WebCore { |
33 | 32 |
34 static void initializeScriptWrappableForInterface(TestInterfaceImplementation* o
bject) | 33 static void initializeScriptWrappableForInterface(TestInterface* object) |
35 { | 34 { |
36 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 35 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
37 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface::wrapperTy
peInfo); | 36 ScriptWrappable::setTypeInfoInObject(object, &V8TestInterface::wrapperTy
peInfo); |
38 else | 37 else |
39 ASSERT_NOT_REACHED(); | 38 ASSERT_NOT_REACHED(); |
40 } | 39 } |
41 | 40 |
42 } // namespace WebCore | 41 } // namespace WebCore |
43 | 42 |
44 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceImplemen
tation* object) | 43 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterface* object
) |
45 { | 44 { |
46 WebCore::initializeScriptWrappableForInterface(object); | 45 WebCore::initializeScriptWrappableForInterface(object); |
47 } | 46 } |
48 | 47 |
49 namespace WebCore { | 48 namespace WebCore { |
50 const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink,
V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toA
ctiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPer
ContextEnabledMethods, &V8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeObject
Prototype, false }; | 49 const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink,
V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toA
ctiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPer
ContextEnabledMethods, 0, WrapperTypeObjectPrototype, false }; |
51 | 50 |
52 namespace TestInterfaceImplementationV8Internal { | 51 namespace TestInterfaceV8Internal { |
53 | 52 |
54 template <typename T> void V8_USE(T) { } | 53 template <typename T> void V8_USE(T) { } |
55 | 54 |
56 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) | |
57 { | |
58 v8::Handle<v8::Object> holder = info.Holder(); | |
59 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
60 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl
); | |
61 } | |
62 | |
63 static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
64 { | |
65 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
66 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeGetter
(info); | |
67 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
68 } | |
69 | |
70 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<void>& info) | |
71 { | |
72 v8::Handle<v8::Object> holder = info.Holder(); | |
73 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceA
ttribute", "TestInterface", holder, info.GetIsolate()); | |
74 if (!isUndefinedOrNull(v8Value) && !V8TestInterface::hasInstance(v8Value, in
fo.GetIsolate())) { | |
75 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface'."); | |
76 exceptionState.throwIfNeeded(); | |
77 return; | |
78 } | |
79 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
80 V8TRYCATCH_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toN
ativeWithTypeCheck(info.GetIsolate(), v8Value)); | |
81 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue)); | |
82 } | |
83 | |
84 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
85 { | |
86 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
87 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter
(v8Value, info); | |
88 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
89 } | |
90 | |
91 static void staticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | |
92 { | |
93 v8SetReturnValueString(info, TestInterfaceImplementation::staticStringAttrib
ute(), info.GetIsolate()); | |
94 } | |
95 | |
96 static void staticStringAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
97 { | |
98 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
99 TestInterfaceImplementationV8Internal::staticStringAttributeAttributeGetter(
info); | |
100 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
101 } | |
102 | |
103 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::PropertyCallbackInfo<void>& info) | |
104 { | |
105 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | |
106 TestInterfaceImplementation::setStaticStringAttribute(cppValue); | |
107 } | |
108 | |
109 static void staticStringAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
110 { | |
111 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
112 TestInterfaceImplementationV8Internal::staticStringAttributeAttributeSetter(
v8Value, info); | |
113 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
114 } | |
115 | |
116 static void perWorldBindingsStringAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) | |
117 { | |
118 v8::Handle<v8::Object> holder = info.Holder(); | |
119 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
120 v8SetReturnValueString(info, impl->perWorldBindingsStringAttribute(), info.G
etIsolate()); | |
121 } | |
122 | |
123 static void perWorldBindingsStringAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
124 { | |
125 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
126 TestInterfaceImplementationV8Internal::perWorldBindingsStringAttributeAttrib
uteGetter(info); | |
127 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
128 } | |
129 | |
130 static void perWorldBindingsStringAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) | |
131 { | |
132 v8::Handle<v8::Object> holder = info.Holder(); | |
133 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
134 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | |
135 impl->setPerWorldBindingsStringAttribute(cppValue); | |
136 } | |
137 | |
138 static void perWorldBindingsStringAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in
fo) | |
139 { | |
140 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
141 TestInterfaceImplementationV8Internal::perWorldBindingsStringAttributeAttrib
uteSetter(v8Value, info); | |
142 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
143 } | |
144 | |
145 static void perWorldBindingsStringAttributeAttributeGetterForMainWorld(const v8:
:PropertyCallbackInfo<v8::Value>& info) | |
146 { | |
147 v8::Handle<v8::Object> holder = info.Holder(); | |
148 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
149 v8SetReturnValueString(info, impl->perWorldBindingsStringAttribute(), info.G
etIsolate()); | |
150 } | |
151 | |
152 static void perWorldBindingsStringAttributeAttributeGetterCallbackForMainWorld(v
8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
153 { | |
154 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
155 TestInterfaceImplementationV8Internal::perWorldBindingsStringAttributeAttrib
uteGetterForMainWorld(info); | |
156 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
157 } | |
158 | |
159 static void perWorldBindingsStringAttributeAttributeSetterForMainWorld(v8::Local
<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
160 { | |
161 v8::Handle<v8::Object> holder = info.Holder(); | |
162 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
163 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | |
164 impl->setPerWorldBindingsStringAttribute(cppValue); | |
165 } | |
166 | |
167 static void perWorldBindingsStringAttributeAttributeSetterCallbackForMainWorld(v
8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackIn
fo<void>& info) | |
168 { | |
169 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
170 TestInterfaceImplementationV8Internal::perWorldBindingsStringAttributeAttrib
uteSetterForMainWorld(v8Value, info); | |
171 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
172 } | |
173 | |
174 static void implementsStaticReadOnlyLongAttributeAttributeGetter(const v8::Prope
rtyCallbackInfo<v8::Value>& info) | 55 static void implementsStaticReadOnlyLongAttributeAttributeGetter(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
175 { | 56 { |
176 v8SetReturnValueInt(info, TestImplements::implementsStaticReadOnlyLongAttrib
ute()); | 57 v8SetReturnValueInt(info, TestImplements::implementsStaticReadOnlyLongAttrib
ute()); |
177 } | 58 } |
178 | 59 |
179 static void implementsStaticReadOnlyLongAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 60 static void implementsStaticReadOnlyLongAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
180 { | 61 { |
181 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 62 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
182 TestInterfaceImplementationV8Internal::implementsStaticReadOnlyLongAttribute
AttributeGetter(info); | 63 TestInterfaceV8Internal::implementsStaticReadOnlyLongAttributeAttributeGette
r(info); |
183 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 64 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
184 } | 65 } |
185 | 66 |
186 static void implementsStaticStringAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) | 67 static void implementsStaticStringAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) |
187 { | 68 { |
188 v8SetReturnValueString(info, TestImplements::implementsStaticStringAttribute
(), info.GetIsolate()); | 69 v8SetReturnValueString(info, TestImplements::implementsStaticStringAttribute
(), info.GetIsolate()); |
189 } | 70 } |
190 | 71 |
191 static void implementsStaticStringAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 72 static void implementsStaticStringAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
192 { | 73 { |
193 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 74 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
194 TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttrib
uteGetter(info); | 75 TestInterfaceV8Internal::implementsStaticStringAttributeAttributeGetter(info
); |
195 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 76 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
196 } | 77 } |
197 | 78 |
198 static void implementsStaticStringAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) | 79 static void implementsStaticStringAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) |
199 { | 80 { |
200 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | 81 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
201 TestImplements::setImplementsStaticStringAttribute(cppValue); | 82 TestImplements::setImplementsStaticStringAttribute(cppValue); |
202 } | 83 } |
203 | 84 |
204 static void implementsStaticStringAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in
fo) | 85 static void implementsStaticStringAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in
fo) |
205 { | 86 { |
206 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 87 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
207 TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttrib
uteSetter(v8Value, info); | 88 TestInterfaceV8Internal::implementsStaticStringAttributeAttributeSetter(v8Va
lue, info); |
208 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 89 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
209 } | 90 } |
210 | 91 |
211 static void implementsReadonlyStringAttributeAttributeGetter(const v8::PropertyC
allbackInfo<v8::Value>& info) | 92 static void implementsReadonlyStringAttributeAttributeGetter(const v8::PropertyC
allbackInfo<v8::Value>& info) |
212 { | 93 { |
213 v8::Handle<v8::Object> holder = info.Holder(); | 94 v8::Handle<v8::Object> holder = info.Holder(); |
214 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 95 TestInterface* impl = V8TestInterface::toNative(holder); |
215 ASSERT(impl); | 96 ASSERT(impl); |
216 v8SetReturnValueString(info, TestImplements::implementsReadonlyStringAttribu
te(*impl), info.GetIsolate()); | 97 v8SetReturnValueString(info, TestImplements::implementsReadonlyStringAttribu
te(*impl), info.GetIsolate()); |
217 } | 98 } |
218 | 99 |
219 static void implementsReadonlyStringAttributeAttributeGetterCallback(v8::Local<v
8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 100 static void implementsReadonlyStringAttributeAttributeGetterCallback(v8::Local<v
8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
220 { | 101 { |
221 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 102 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
222 TestInterfaceImplementationV8Internal::implementsReadonlyStringAttributeAttr
ibuteGetter(info); | 103 TestInterfaceV8Internal::implementsReadonlyStringAttributeAttributeGetter(in
fo); |
223 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 104 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
224 } | 105 } |
225 | 106 |
226 static void implementsStringAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) | 107 static void implementsStringAttributeAttributeGetter(const v8::PropertyCallbackI
nfo<v8::Value>& info) |
227 { | 108 { |
228 v8::Handle<v8::Object> holder = info.Holder(); | 109 v8::Handle<v8::Object> holder = info.Holder(); |
229 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 110 TestInterface* impl = V8TestInterface::toNative(holder); |
230 ASSERT(impl); | 111 ASSERT(impl); |
231 v8SetReturnValueString(info, TestImplements::implementsStringAttribute(*impl
), info.GetIsolate()); | 112 v8SetReturnValueString(info, TestImplements::implementsStringAttribute(*impl
), info.GetIsolate()); |
232 } | 113 } |
233 | 114 |
234 static void implementsStringAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) | 115 static void implementsStringAttributeAttributeGetterCallback(v8::Local<v8::Strin
g>, const v8::PropertyCallbackInfo<v8::Value>& info) |
235 { | 116 { |
236 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 117 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
237 TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeGet
ter(info); | 118 TestInterfaceV8Internal::implementsStringAttributeAttributeGetter(info); |
238 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 119 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
239 } | 120 } |
240 | 121 |
241 static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
e, const v8::PropertyCallbackInfo<void>& info) | 122 static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> v8Valu
e, const v8::PropertyCallbackInfo<void>& info) |
242 { | 123 { |
243 v8::Handle<v8::Object> holder = info.Holder(); | 124 v8::Handle<v8::Object> holder = info.Holder(); |
244 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 125 TestInterface* impl = V8TestInterface::toNative(holder); |
245 ASSERT(impl); | 126 ASSERT(impl); |
246 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | 127 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
247 TestImplements::setImplementsStringAttribute(*impl, cppValue); | 128 TestImplements::setImplementsStringAttribute(*impl, cppValue); |
248 } | 129 } |
249 | 130 |
250 static void implementsStringAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 131 static void implementsStringAttributeAttributeSetterCallback(v8::Local<v8::Strin
g>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
251 { | 132 { |
252 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 133 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
253 TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeSet
ter(v8Value, info); | 134 TestInterfaceV8Internal::implementsStringAttributeAttributeSetter(v8Value, i
nfo); |
254 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 135 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
255 } | 136 } |
256 | 137 |
257 static void implementsNodeAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) | 138 static void implementsNodeAttributeAttributeGetter(const v8::PropertyCallbackInf
o<v8::Value>& info) |
258 { | 139 { |
259 v8::Handle<v8::Object> holder = info.Holder(); | 140 v8::Handle<v8::Object> holder = info.Holder(); |
260 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 141 TestInterface* impl = V8TestInterface::toNative(holder); |
261 ASSERT(impl); | 142 ASSERT(impl); |
262 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsNodeAttribu
te(*impl)), impl); | 143 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsNodeAttribu
te(*impl)), impl); |
263 } | 144 } |
264 | 145 |
265 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) | 146 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String>
, const v8::PropertyCallbackInfo<v8::Value>& info) |
266 { | 147 { |
267 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 148 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
268 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeGette
r(info); | 149 TestInterfaceV8Internal::implementsNodeAttributeAttributeGetter(info); |
269 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 150 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
270 } | 151 } |
271 | 152 |
272 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<void>& info) | 153 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<void>& info) |
273 { | 154 { |
274 v8::Handle<v8::Object> holder = info.Holder(); | 155 v8::Handle<v8::Object> holder = info.Holder(); |
275 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNode
Attribute", "TestInterface", holder, info.GetIsolate()); | 156 TestInterface* impl = V8TestInterface::toNative(holder); |
276 if (!isUndefinedOrNull(v8Value) && !V8Node::hasInstance(v8Value, info.GetIso
late())) { | |
277 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); | |
278 exceptionState.throwIfNeeded(); | |
279 return; | |
280 } | |
281 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
282 ASSERT(impl); | 157 ASSERT(impl); |
283 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); | 158 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); |
284 TestImplements::setImplementsNodeAttribute(*impl, WTF::getPtr(cppValue)); | 159 TestImplements::setImplementsNodeAttribute(*impl, WTF::getPtr(cppValue)); |
285 } | 160 } |
286 | 161 |
287 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 162 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String>
, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
288 { | 163 { |
289 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
290 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSette
r(v8Value, info); | 165 TestInterfaceV8Internal::implementsNodeAttributeAttributeSetter(v8Value, inf
o); |
291 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
292 } | 167 } |
293 | 168 |
294 static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) | 169 static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) |
295 { | 170 { |
296 v8::Handle<v8::Object> holder = info.Holder(); | 171 v8::Handle<v8::Object> holder = info.Holder(); |
297 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 172 TestInterface* impl = V8TestInterface::toNative(holder); |
298 ASSERT(impl); | 173 ASSERT(impl); |
299 EventListener* v8Value = TestImplements::implementsEventHandlerAttribute(*im
pl); | 174 EventListener* v8Value = TestImplements::implementsEventHandlerAttribute(*im
pl); |
300 v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8:
:Value>(v8::Null(info.GetIsolate()))); | 175 v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListen
er::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8:
:Value>(v8::Null(info.GetIsolate()))); |
301 } | 176 } |
302 | 177 |
303 static void implementsEventHandlerAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 178 static void implementsEventHandlerAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
304 { | 179 { |
305 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 180 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
306 TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttrib
uteGetter(info); | 181 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeGetter(info
); |
307 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 182 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
308 } | 183 } |
309 | 184 |
310 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) | 185 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) |
311 { | 186 { |
312 v8::Handle<v8::Object> holder = info.Holder(); | 187 v8::Handle<v8::Object> holder = info.Holder(); |
313 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 188 TestInterface* impl = V8TestInterface::toNative(holder); |
314 ASSERT(impl); | 189 ASSERT(impl); |
315 moveEventListenerToNewWrapper(holder, TestImplements::implementsEventHandler
Attribute(*impl), v8Value, V8TestInterface::eventListenerCacheIndex, info.GetIso
late()); | 190 moveEventListenerToNewWrapper(holder, TestImplements::implementsEventHandler
Attribute(*impl), v8Value, V8TestInterface::eventListenerCacheIndex, info.GetIso
late()); |
316 TestImplements::setImplementsEventHandlerAttribute(*impl, V8EventListenerLis
t::getEventListener(v8Value, true, ListenerFindOrCreate)); | 191 TestImplements::setImplementsEventHandlerAttribute(*impl, V8EventListenerLis
t::getEventListener(v8Value, true, ListenerFindOrCreate)); |
317 } | 192 } |
318 | 193 |
319 static void implementsEventHandlerAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in
fo) | 194 static void implementsEventHandlerAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in
fo) |
320 { | 195 { |
321 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 196 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
322 TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttrib
uteSetter(v8Value, info); | 197 TestInterfaceV8Internal::implementsEventHandlerAttributeAttributeSetter(v8Va
lue, info); |
323 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 198 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
324 } | 199 } |
325 | 200 |
326 static void implementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::Prope
rtyCallbackInfo<v8::Value>& info) | 201 static void implementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
327 { | 202 { |
328 v8::Handle<v8::Object> holder = info.Holder(); | 203 v8::Handle<v8::Object> holder = info.Holder(); |
329 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 204 TestInterface* impl = V8TestInterface::toNative(holder); |
330 ASSERT(impl); | 205 ASSERT(impl); |
331 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsRuntimeEnab
ledNodeAttribute(*impl)), impl); | 206 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsRuntimeEnab
ledNodeAttribute(*impl)), impl); |
332 } | 207 } |
333 | 208 |
334 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 209 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Loc
al<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
335 { | 210 { |
336 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 211 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
337 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute
AttributeGetter(info); | 212 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGette
r(info); |
338 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 213 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
339 } | 214 } |
340 | 215 |
341 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V
alue> v8Value, const v8::PropertyCallbackInfo<void>& info) | 216 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::V
alue> v8Value, const v8::PropertyCallbackInfo<void>& info) |
342 { | 217 { |
343 v8::Handle<v8::Object> holder = info.Holder(); | 218 v8::Handle<v8::Object> holder = info.Holder(); |
344 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRunt
imeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); | 219 TestInterface* impl = V8TestInterface::toNative(holder); |
345 if (!isUndefinedOrNull(v8Value) && !V8Node::hasInstance(v8Value, info.GetIso
late())) { | |
346 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); | |
347 exceptionState.throwIfNeeded(); | |
348 return; | |
349 } | |
350 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
351 ASSERT(impl); | 220 ASSERT(impl); |
352 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); | 221 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); |
353 TestImplements::setImplementsRuntimeEnabledNodeAttribute(*impl, WTF::getPtr(
cppValue)); | 222 TestImplements::setImplementsRuntimeEnabledNodeAttribute(*impl, WTF::getPtr(
cppValue)); |
354 } | 223 } |
355 | 224 |
356 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc
al<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi
d>& info) | 225 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Loc
al<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<voi
d>& info) |
357 { | 226 { |
358 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 227 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
359 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttribute
AttributeSetter(v8Value, info); | 228 TestInterfaceV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSette
r(v8Value, info); |
360 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 229 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
361 } | 230 } |
362 | 231 |
363 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 232 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
364 { | 233 { |
365 v8::Handle<v8::Object> holder = info.Holder(); | 234 v8::Handle<v8::Object> holder = info.Holder(); |
366 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 235 TestInterface* impl = V8TestInterface::toNative(holder); |
367 ASSERT(impl); | 236 ASSERT(impl); |
368 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsPerContextE
nabledNodeAttribute(*impl)), impl); | 237 v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsPerContextE
nabledNodeAttribute(*impl)), impl); |
369 } | 238 } |
370 | 239 |
371 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 240 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
372 { | 241 { |
373 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 242 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
374 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib
uteAttributeGetter(info); | 243 TestInterfaceV8Internal::implementsPerContextEnabledNodeAttributeAttributeGe
tter(info); |
375 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 244 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
376 } | 245 } |
377 | 246 |
378 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 247 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
379 { | 248 { |
380 v8::Handle<v8::Object> holder = info.Holder(); | 249 v8::Handle<v8::Object> holder = info.Holder(); |
381 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsPerC
ontextEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate()); | 250 TestInterface* impl = V8TestInterface::toNative(holder); |
382 if (!isUndefinedOrNull(v8Value) && !V8Node::hasInstance(v8Value, info.GetIso
late())) { | |
383 exceptionState.throwTypeError("The provided value is not of type 'Node'.
"); | |
384 exceptionState.throwIfNeeded(); | |
385 return; | |
386 } | |
387 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
388 ASSERT(impl); | 251 ASSERT(impl); |
389 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); | 252 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); |
390 TestImplements::setImplementsPerContextEnabledNodeAttribute(*impl, WTF::getP
tr(cppValue)); | 253 TestImplements::setImplementsPerContextEnabledNodeAttribute(*impl, WTF::getP
tr(cppValue)); |
391 } | 254 } |
392 | 255 |
393 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<
void>& info) | 256 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<
void>& info) |
394 { | 257 { |
395 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 258 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
396 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttrib
uteAttributeSetter(v8Value, info); | 259 TestInterfaceV8Internal::implementsPerContextEnabledNodeAttributeAttributeSe
tter(v8Value, info); |
397 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 260 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
398 } | 261 } |
399 | 262 |
400 static void implements2StaticStringAttributeAttributeGetter(const v8::PropertyCa
llbackInfo<v8::Value>& info) | 263 #if ENABLE(CONDITION_PARTIAL) |
401 { | 264 static void supplementalStaticReadOnlyAttrAttributeGetter(const v8::PropertyCall
backInfo<v8::Value>& info) |
402 v8SetReturnValueString(info, TestImplements2Implementation::implements2Stati
cStringAttribute(), info.GetIsolate()); | 265 { |
403 } | 266 v8SetReturnValueInt(info, TestPartialInterface::supplementalStaticReadOnlyAt
tr()); |
404 | 267 } |
405 static void implements2StaticStringAttributeAttributeGetterCallback(v8::Local<v8
::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 268 #endif // ENABLE(CONDITION_PARTIAL) |
406 { | 269 |
407 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 270 #if ENABLE(CONDITION_PARTIAL) |
408 TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttri
buteGetter(info); | 271 static void supplementalStaticReadOnlyAttrAttributeGetterCallback(v8::Local<v8::
String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
409 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 272 { |
410 } | 273 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
411 | 274 TestInterfaceV8Internal::supplementalStaticReadOnlyAttrAttributeGetter(info)
; |
412 static void implements2StaticStringAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) | 275 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 276 } |
| 277 #endif // ENABLE(CONDITION_PARTIAL) |
| 278 |
| 279 #if ENABLE(CONDITION_PARTIAL) |
| 280 static void supplementalStaticAttrAttributeGetter(const v8::PropertyCallbackInfo
<v8::Value>& info) |
| 281 { |
| 282 v8SetReturnValueString(info, TestPartialInterface::supplementalStaticAttr(),
info.GetIsolate()); |
| 283 } |
| 284 #endif // ENABLE(CONDITION_PARTIAL) |
| 285 |
| 286 #if ENABLE(CONDITION_PARTIAL) |
| 287 static void supplementalStaticAttrAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) |
| 288 { |
| 289 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 290 TestInterfaceV8Internal::supplementalStaticAttrAttributeGetter(info); |
| 291 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 292 } |
| 293 #endif // ENABLE(CONDITION_PARTIAL) |
| 294 |
| 295 #if ENABLE(CONDITION_PARTIAL) |
| 296 static void supplementalStaticAttrAttributeSetter(v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<void>& info) |
413 { | 297 { |
414 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | 298 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
415 TestImplements2Implementation::setImplements2StaticStringAttribute(cppValue)
; | 299 TestPartialInterface::setSupplementalStaticAttr(cppValue); |
416 } | 300 } |
417 | 301 #endif // ENABLE(CONDITION_PARTIAL) |
418 static void implements2StaticStringAttributeAttributeSetterCallback(v8::Local<v8
::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& i
nfo) | 302 |
419 { | 303 #if ENABLE(CONDITION_PARTIAL) |
420 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 304 static void supplementalStaticAttrAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
421 TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttri
buteSetter(v8Value, info); | 305 { |
422 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 306 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
423 } | 307 TestInterfaceV8Internal::supplementalStaticAttrAttributeSetter(v8Value, info
); |
424 | 308 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
425 static void implements2StringAttributeAttributeGetter(const v8::PropertyCallback
Info<v8::Value>& info) | 309 } |
426 { | 310 #endif // ENABLE(CONDITION_PARTIAL) |
427 v8::Handle<v8::Object> holder = info.Holder(); | 311 |
428 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 312 #if ENABLE(CONDITION_PARTIAL) |
429 ASSERT(impl); | 313 static void supplementalStr1AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
430 v8SetReturnValueString(info, TestImplements2Implementation::implements2Strin
gAttribute(*impl), info.GetIsolate()); | 314 { |
431 } | 315 v8::Handle<v8::Object> holder = info.Holder(); |
432 | 316 TestInterface* impl = V8TestInterface::toNative(holder); |
433 static void implements2StringAttributeAttributeGetterCallback(v8::Local<v8::Stri
ng>, const v8::PropertyCallbackInfo<v8::Value>& info) | 317 ASSERT(impl); |
434 { | 318 v8SetReturnValueString(info, TestPartialInterface::supplementalStr1(*impl),
info.GetIsolate()); |
435 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 319 } |
436 TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeGe
tter(info); | 320 #endif // ENABLE(CONDITION_PARTIAL) |
437 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 321 |
438 } | 322 #if ENABLE(CONDITION_PARTIAL) |
439 | 323 static void supplementalStr1AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
440 static void implements2StringAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::PropertyCallbackInfo<void>& info) | 324 { |
441 { | 325 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
442 v8::Handle<v8::Object> holder = info.Holder(); | 326 TestInterfaceV8Internal::supplementalStr1AttributeGetter(info); |
443 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 327 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 328 } |
| 329 #endif // ENABLE(CONDITION_PARTIAL) |
| 330 |
| 331 #if ENABLE(CONDITION_PARTIAL) |
| 332 static void supplementalStr2AttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
| 333 { |
| 334 v8::Handle<v8::Object> holder = info.Holder(); |
| 335 TestInterface* impl = V8TestInterface::toNative(holder); |
| 336 ASSERT(impl); |
| 337 v8SetReturnValueString(info, TestPartialInterface::supplementalStr2(*impl),
info.GetIsolate()); |
| 338 } |
| 339 #endif // ENABLE(CONDITION_PARTIAL) |
| 340 |
| 341 #if ENABLE(CONDITION_PARTIAL) |
| 342 static void supplementalStr2AttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
| 343 { |
| 344 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
| 345 TestInterfaceV8Internal::supplementalStr2AttributeGetter(info); |
| 346 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
| 347 } |
| 348 #endif // ENABLE(CONDITION_PARTIAL) |
| 349 |
| 350 #if ENABLE(CONDITION_PARTIAL) |
| 351 static void supplementalStr2AttributeSetter(v8::Local<v8::Value> v8Value, const
v8::PropertyCallbackInfo<void>& info) |
| 352 { |
| 353 v8::Handle<v8::Object> holder = info.Holder(); |
| 354 TestInterface* impl = V8TestInterface::toNative(holder); |
444 ASSERT(impl); | 355 ASSERT(impl); |
445 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | 356 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); |
446 TestImplements2Implementation::setImplements2StringAttribute(*impl, cppValue
); | 357 TestPartialInterface::setSupplementalStr2(*impl, cppValue); |
447 } | 358 } |
448 | 359 #endif // ENABLE(CONDITION_PARTIAL) |
449 static void implements2StringAttributeAttributeSetterCallback(v8::Local<v8::Stri
ng>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 360 |
450 { | 361 #if ENABLE(CONDITION_PARTIAL) |
451 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 362 static void supplementalStr2AttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
452 TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeSe
tter(v8Value, info); | 363 { |
453 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 364 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
454 } | 365 TestInterfaceV8Internal::supplementalStr2AttributeSetter(v8Value, info); |
455 | 366 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
456 static void implements3StringAttributeAttributeGetter(const v8::PropertyCallback
Info<v8::Value>& info) | 367 } |
457 { | 368 #endif // ENABLE(CONDITION_PARTIAL) |
458 v8::Handle<v8::Object> holder = info.Holder(); | 369 |
459 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 370 #if ENABLE(CONDITION_PARTIAL) |
460 v8SetReturnValueString(info, impl->implements3StringAttribute(), info.GetIso
late()); | 371 static void supplementalNodeAttributeGetter(const v8::PropertyCallbackInfo<v8::V
alue>& info) |
461 } | 372 { |
462 | 373 v8::Handle<v8::Object> holder = info.Holder(); |
463 static void implements3StringAttributeAttributeGetterCallback(v8::Local<v8::Stri
ng>, const v8::PropertyCallbackInfo<v8::Value>& info) | 374 TestInterface* impl = V8TestInterface::toNative(holder); |
464 { | 375 ASSERT(impl); |
465 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 376 v8SetReturnValueFast(info, WTF::getPtr(TestPartialInterface::supplementalNod
e(*impl)), impl); |
466 TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeGe
tter(info); | 377 } |
467 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 378 #endif // ENABLE(CONDITION_PARTIAL) |
468 } | 379 |
469 | 380 #if ENABLE(CONDITION_PARTIAL) |
470 static void implements3StringAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::PropertyCallbackInfo<void>& info) | 381 static void supplementalNodeAttributeGetterCallback(v8::Local<v8::String>, const
v8::PropertyCallbackInfo<v8::Value>& info) |
471 { | 382 { |
472 v8::Handle<v8::Object> holder = info.Holder(); | 383 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
473 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 384 TestInterfaceV8Internal::supplementalNodeAttributeGetter(info); |
474 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | 385 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
475 impl->setImplements3StringAttribute(cppValue); | 386 } |
476 } | 387 #endif // ENABLE(CONDITION_PARTIAL) |
477 | 388 |
478 static void implements3StringAttributeAttributeSetterCallback(v8::Local<v8::Stri
ng>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | 389 #if ENABLE(CONDITION_PARTIAL) |
479 { | 390 static void supplementalNodeAttributeSetter(v8::Local<v8::Value> v8Value, const
v8::PropertyCallbackInfo<void>& info) |
480 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 391 { |
481 TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeSe
tter(v8Value, info); | 392 v8::Handle<v8::Object> holder = info.Holder(); |
482 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 393 TestInterface* impl = V8TestInterface::toNative(holder); |
483 } | 394 ASSERT(impl); |
484 | 395 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); |
485 static void implements3StaticStringAttributeAttributeGetter(const v8::PropertyCa
llbackInfo<v8::Value>& info) | 396 TestPartialInterface::setSupplementalNode(*impl, WTF::getPtr(cppValue)); |
486 { | 397 } |
487 v8SetReturnValueString(info, TestInterfaceImplementation::implements3StaticS
tringAttribute(), info.GetIsolate()); | 398 #endif // ENABLE(CONDITION_PARTIAL) |
488 } | 399 |
489 | 400 #if ENABLE(CONDITION_PARTIAL) |
490 static void implements3StaticStringAttributeAttributeGetterCallback(v8::Local<v8
::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 401 static void supplementalNodeAttributeSetterCallback(v8::Local<v8::String>, v8::L
ocal<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) |
491 { | 402 { |
492 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 403 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
493 TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttri
buteGetter(info); | 404 TestInterfaceV8Internal::supplementalNodeAttributeSetter(v8Value, info); |
494 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 405 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
495 } | 406 } |
496 | 407 #endif // ENABLE(CONDITION_PARTIAL) |
497 static void implements3StaticStringAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) | 408 |
498 { | 409 #if ENABLE(CONDITION_PARTIAL) |
499 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | 410 static void Node13AttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& inf
o) |
500 TestInterfaceImplementation::setImplements3StaticStringAttribute(cppValue); | 411 { |
501 } | 412 v8::Handle<v8::Object> holder = info.Holder(); |
502 | 413 TestInterface* impl = V8TestInterface::toNative(holder); |
503 static void implements3StaticStringAttributeAttributeSetterCallback(v8::Local<v8
::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& i
nfo) | 414 ASSERT(impl); |
504 { | 415 v8SetReturnValueFast(info, WTF::getPtr(TestPartialInterface::node13(*impl)),
impl); |
505 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 416 } |
506 TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttri
buteSetter(v8Value, info); | 417 #endif // ENABLE(CONDITION_PARTIAL) |
507 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 418 |
508 } | 419 #if ENABLE(CONDITION_PARTIAL) |
509 | 420 static void Node13AttributeGetterCallback(v8::Local<v8::String>, const v8::Prope
rtyCallbackInfo<v8::Value>& info) |
510 #if ENABLE(PARTIAL_CONDITION) | 421 { |
511 static void partialLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v
8::Value>& info) | 422 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
512 { | 423 TestInterfaceV8Internal::Node13AttributeGetter(info); |
513 v8::Handle<v8::Object> holder = info.Holder(); | 424 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
514 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 425 } |
515 ASSERT(impl); | 426 #endif // ENABLE(CONDITION_PARTIAL) |
516 v8SetReturnValueInt(info, TestPartialInterface::partialLongAttribute(*impl))
; | 427 |
517 } | 428 #if ENABLE(CONDITION_PARTIAL) |
518 #endif // ENABLE(PARTIAL_CONDITION) | 429 static void Node13AttributeSetter(v8::Local<v8::Value> v8Value, const v8::Proper
tyCallbackInfo<void>& info) |
519 | 430 { |
520 #if ENABLE(PARTIAL_CONDITION) | 431 v8::Handle<v8::Object> holder = info.Holder(); |
521 static void partialLongAttributeAttributeGetterCallback(v8::Local<v8::String>, c
onst v8::PropertyCallbackInfo<v8::Value>& info) | 432 TestInterface* impl = V8TestInterface::toNative(holder); |
522 { | 433 ASSERT(impl); |
523 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 434 V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsola
te(), v8Value)); |
524 TestInterfaceImplementationV8Internal::partialLongAttributeAttributeGetter(i
nfo); | 435 TestPartialInterface::setNode13(*impl, WTF::getPtr(cppValue)); |
525 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 436 } |
526 } | 437 #endif // ENABLE(CONDITION_PARTIAL) |
527 #endif // ENABLE(PARTIAL_CONDITION) | 438 |
528 | 439 #if ENABLE(CONDITION_PARTIAL) |
529 #if ENABLE(PARTIAL_CONDITION) | 440 static void Node13AttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::V
alue> v8Value, const v8::PropertyCallbackInfo<void>& info) |
530 static void partialLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, co
nst v8::PropertyCallbackInfo<void>& info) | 441 { |
531 { | 442 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
532 v8::Handle<v8::Object> holder = info.Holder(); | 443 TestInterfaceV8Internal::Node13AttributeSetter(v8Value, info); |
533 ExceptionState exceptionState(ExceptionState::SetterContext, "partialLongAtt
ribute", "TestInterface", holder, info.GetIsolate()); | 444 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
534 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | 445 } |
535 ASSERT(impl); | 446 #endif // ENABLE(CONDITION_PARTIAL) |
536 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), e
xceptionState); | 447 |
537 TestPartialInterface::setPartialLongAttribute(*impl, cppValue); | 448 static void namedItemMethod(const v8::FunctionCallbackInfo<v8::Value>& info) |
538 } | |
539 #endif // ENABLE(PARTIAL_CONDITION) | |
540 | |
541 #if ENABLE(PARTIAL_CONDITION) | |
542 static void partialLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v
8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
543 { | |
544 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
545 TestInterfaceImplementationV8Internal::partialLongAttributeAttributeSetter(v
8Value, info); | |
546 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
547 } | |
548 #endif // ENABLE(PARTIAL_CONDITION) | |
549 | |
550 #if ENABLE(PARTIAL_CONDITION) | |
551 static void partialStaticLongAttributeAttributeGetter(const v8::PropertyCallback
Info<v8::Value>& info) | |
552 { | |
553 v8SetReturnValueInt(info, TestPartialInterface::partialStaticLongAttribute()
); | |
554 } | |
555 #endif // ENABLE(PARTIAL_CONDITION) | |
556 | |
557 #if ENABLE(PARTIAL_CONDITION) | |
558 static void partialStaticLongAttributeAttributeGetterCallback(v8::Local<v8::Stri
ng>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
559 { | |
560 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
561 TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeGe
tter(info); | |
562 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
563 } | |
564 #endif // ENABLE(PARTIAL_CONDITION) | |
565 | |
566 #if ENABLE(PARTIAL_CONDITION) | |
567 static void partialStaticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Val
ue, const v8::PropertyCallbackInfo<void>& info) | |
568 { | |
569 ExceptionState exceptionState(ExceptionState::SetterContext, "partialStaticL
ongAttribute", "TestInterface", holder, info.GetIsolate()); | |
570 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), e
xceptionState); | |
571 TestPartialInterface::setPartialStaticLongAttribute(cppValue); | |
572 } | |
573 #endif // ENABLE(PARTIAL_CONDITION) | |
574 | |
575 #if ENABLE(PARTIAL_CONDITION) | |
576 static void partialStaticLongAttributeAttributeSetterCallback(v8::Local<v8::Stri
ng>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
577 { | |
578 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
579 TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeSe
tter(v8Value, info); | |
580 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
581 } | |
582 #endif // ENABLE(PARTIAL_CONDITION) | |
583 | |
584 #if ENABLE(PARTIAL_CONDITION) | |
585 static void partialCallWithExecutionContextLongAttributeAttributeGetter(const v8
::PropertyCallbackInfo<v8::Value>& info) | |
586 { | |
587 v8::Handle<v8::Object> holder = info.Holder(); | |
588 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
589 ASSERT(impl); | |
590 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate())
; | |
591 v8SetReturnValueInt(info, TestPartialInterface::partialCallWithExecutionCont
extLongAttribute(scriptContext, *impl)); | |
592 } | |
593 #endif // ENABLE(PARTIAL_CONDITION) | |
594 | |
595 #if ENABLE(PARTIAL_CONDITION) | |
596 static void partialCallWithExecutionContextLongAttributeAttributeGetterCallback(
v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
597 { | |
598 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
599 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAt
tributeAttributeGetter(info); | |
600 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
601 } | |
602 #endif // ENABLE(PARTIAL_CONDITION) | |
603 | |
604 #if ENABLE(PARTIAL_CONDITION) | |
605 static void partialCallWithExecutionContextLongAttributeAttributeSetter(v8::Loca
l<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
606 { | |
607 v8::Handle<v8::Object> holder = info.Holder(); | |
608 ExceptionState exceptionState(ExceptionState::SetterContext, "partialCallWit
hExecutionContextLongAttribute", "TestInterface", holder, info.GetIsolate()); | |
609 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
610 ASSERT(impl); | |
611 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), e
xceptionState); | |
612 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate())
; | |
613 TestPartialInterface::setPartialCallWithExecutionContextLongAttribute(script
Context, *impl, cppValue); | |
614 } | |
615 #endif // ENABLE(PARTIAL_CONDITION) | |
616 | |
617 #if ENABLE(PARTIAL_CONDITION) | |
618 static void partialCallWithExecutionContextLongAttributeAttributeSetterCallback(
v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackI
nfo<void>& info) | |
619 { | |
620 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
621 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAt
tributeAttributeSetter(v8Value, info); | |
622 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
623 } | |
624 #endif // ENABLE(PARTIAL_CONDITION) | |
625 | |
626 #if ENABLE(PARTIAL_CONDITION) | |
627 static void partialPartialEnumTypeAttributeAttributeGetter(const v8::PropertyCal
lbackInfo<v8::Value>& info) | |
628 { | |
629 v8::Handle<v8::Object> holder = info.Holder(); | |
630 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
631 ASSERT(impl); | |
632 v8SetReturnValueString(info, TestPartialInterface::partialPartialEnumTypeAtt
ribute(*impl), info.GetIsolate()); | |
633 } | |
634 #endif // ENABLE(PARTIAL_CONDITION) | |
635 | |
636 #if ENABLE(PARTIAL_CONDITION) | |
637 static void partialPartialEnumTypeAttributeAttributeGetterCallback(v8::Local<v8:
:String>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
638 { | |
639 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
640 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttrib
uteGetter(info); | |
641 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
642 } | |
643 #endif // ENABLE(PARTIAL_CONDITION) | |
644 | |
645 #if ENABLE(PARTIAL_CONDITION) | |
646 static void partialPartialEnumTypeAttributeAttributeSetter(v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<void>& info) | |
647 { | |
648 v8::Handle<v8::Object> holder = info.Holder(); | |
649 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
650 ASSERT(impl); | |
651 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value); | |
652 String string = cppValue; | |
653 if (!(string == "foo" || string == "bar")) | |
654 return; | |
655 TestPartialInterface::setPartialPartialEnumTypeAttribute(*impl, cppValue); | |
656 } | |
657 #endif // ENABLE(PARTIAL_CONDITION) | |
658 | |
659 #if ENABLE(PARTIAL_CONDITION) | |
660 static void partialPartialEnumTypeAttributeAttributeSetterCallback(v8::Local<v8:
:String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& in
fo) | |
661 { | |
662 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
663 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttrib
uteSetter(v8Value, info); | |
664 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
665 } | |
666 #endif // ENABLE(PARTIAL_CONDITION) | |
667 | |
668 static void partial2LongAttributeAttributeGetter(const v8::PropertyCallbackInfo<
v8::Value>& info) | |
669 { | |
670 v8::Handle<v8::Object> holder = info.Holder(); | |
671 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
672 ASSERT(impl); | |
673 v8SetReturnValueInt(info, TestPartialInterfaceImplementation::partial2LongAt
tribute(*impl)); | |
674 } | |
675 | |
676 static void partial2LongAttributeAttributeGetterCallback(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
677 { | |
678 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
679 TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeGetter(
info); | |
680 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
681 } | |
682 | |
683 static void partial2LongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c
onst v8::PropertyCallbackInfo<void>& info) | |
684 { | |
685 v8::Handle<v8::Object> holder = info.Holder(); | |
686 ExceptionState exceptionState(ExceptionState::SetterContext, "partial2LongAt
tribute", "TestInterface", holder, info.GetIsolate()); | |
687 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder); | |
688 ASSERT(impl); | |
689 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), e
xceptionState); | |
690 TestPartialInterfaceImplementation::setPartial2LongAttribute(*impl, cppValue
); | |
691 } | |
692 | |
693 static void partial2LongAttributeAttributeSetterCallback(v8::Local<v8::String>,
v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
694 { | |
695 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
696 TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeSetter(
v8Value, info); | |
697 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
698 } | |
699 | |
700 static void partial2StaticLongAttributeAttributeGetter(const v8::PropertyCallbac
kInfo<v8::Value>& info) | |
701 { | |
702 v8SetReturnValueInt(info, TestPartialInterfaceImplementation::partial2Static
LongAttribute()); | |
703 } | |
704 | |
705 static void partial2StaticLongAttributeAttributeGetterCallback(v8::Local<v8::Str
ing>, const v8::PropertyCallbackInfo<v8::Value>& info) | |
706 { | |
707 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | |
708 TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeG
etter(info); | |
709 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
710 } | |
711 | |
712 static void partial2StaticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Va
lue, const v8::PropertyCallbackInfo<void>& info) | |
713 { | |
714 ExceptionState exceptionState(ExceptionState::SetterContext, "partial2Static
LongAttribute", "TestInterface", holder, info.GetIsolate()); | |
715 V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), e
xceptionState); | |
716 TestPartialInterfaceImplementation::setPartial2StaticLongAttribute(cppValue)
; | |
717 } | |
718 | |
719 static void partial2StaticLongAttributeAttributeSetterCallback(v8::Local<v8::Str
ing>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info) | |
720 { | |
721 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | |
722 TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeS
etter(v8Value, info); | |
723 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
724 } | |
725 | |
726 static void TestInterfaceImplementationConstructorGetter(v8::Local<v8::String>,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
727 { | |
728 v8::Handle<v8::Value> data = info.Data(); | |
729 ASSERT(data->IsExternal()); | |
730 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->Cre
ationContext()); | |
731 if (!perContextData) | |
732 return; | |
733 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::u
nwrap(data))); | |
734 } | |
735 | |
736 static void TestInterfaceImplementationReplaceableAttributeSetter(v8::Local<v8::
String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>
& info) | |
737 { | |
738 info.This()->ForceSet(name, v8Value); | |
739 } | |
740 | |
741 static void TestInterfaceImplementationReplaceableAttributeSetterCallback(v8::Lo
cal<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackIn
fo<void>& info) | |
742 { | |
743 TestInterfaceImplementationV8Internal::TestInterfaceImplementationReplaceabl
eAttributeSetter(name, v8Value, info); | |
744 } | |
745 | |
746 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo
<v8::Value>& info) | |
747 { | 449 { |
748 if (UNLIKELY(info.Length() < 1)) { | 450 if (UNLIKELY(info.Length() < 1)) { |
749 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfa
ceEmptyArg", "TestInterface", ExceptionMessages::notEnoughArguments(1, info.Leng
th())), info.GetIsolate()); | 451 throwTypeError(ExceptionMessages::failedToExecute("namedItem", "TestInte
rface", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolat
e()); |
750 return; | 452 return; |
751 } | 453 } |
752 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 454 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
753 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.Ge
tIsolate())) { | 455 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, name, info[0]); |
754 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfa
ceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'."
), info.GetIsolate()); | 456 bool result0Enabled = false; |
| 457 RefPtr<Node> result0; |
| 458 bool result1Enabled = false; |
| 459 RefPtr<NodeList> result1; |
| 460 impl->getItem(name, result0Enabled, result0, result1Enabled, result1); |
| 461 if (result0Enabled) { |
| 462 v8SetReturnValue(info, result0.release()); |
755 return; | 463 return; |
756 } | 464 } |
757 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::toNativeWithTypeCheck(info.GetIsolate(), info[0])); | 465 if (result1Enabled) { |
758 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); | 466 v8SetReturnValue(info, result1.release()); |
759 } | 467 return; |
760 | 468 } |
761 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCall
backInfo<v8::Value>& info) | 469 v8SetReturnValueNull(info); |
| 470 } |
| 471 |
| 472 static void namedItemMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) |
762 { | 473 { |
763 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 474 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
764 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod
(info); | 475 TestInterfaceV8Internal::namedItemMethod(info); |
765 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
766 } | |
767 | |
768 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | |
769 { | |
770 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
771 impl->voidMethod(); | |
772 } | |
773 | |
774 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>&
info) | |
775 { | |
776 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
777 TestInterfaceImplementationV8Internal::voidMethodMethod(info); | |
778 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
779 } | |
780 | |
781 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu
e>& info) | |
782 { | |
783 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
784 impl->voidMethod(); | |
785 } | |
786 | |
787 static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<
v8::Value>& info) | |
788 { | |
789 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
790 TestInterfaceImplementationV8Internal::voidMethodMethodForMainWorld(info); | |
791 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 476 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
792 } | 477 } |
793 | 478 |
794 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) | 479 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>
& info) |
795 { | 480 { |
796 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 481 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
797 ASSERT(impl); | 482 ASSERT(impl); |
798 TestImplements::implementsVoidMethod(*impl); | 483 TestImplements::implementsVoidMethod(*impl); |
799 } | 484 } |
800 | 485 |
801 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) | 486 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8
::Value>& info) |
802 { | 487 { |
803 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 488 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
804 TestInterfaceImplementationV8Internal::implementsVoidMethodMethod(info); | 489 TestInterfaceV8Internal::implementsVoidMethodMethod(info); |
805 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 490 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
806 } | 491 } |
807 | 492 |
808 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | 493 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
809 { | 494 { |
810 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC
omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); | 495 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsC
omplexMethod", "TestInterface", info.Holder(), info.GetIsolate()); |
811 if (UNLIKELY(info.Length() < 2)) { | 496 if (UNLIKELY(info.Length() < 2)) { |
812 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); | 497 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
813 exceptionState.throwIfNeeded(); | 498 exceptionState.throwIfNeeded(); |
814 return; | 499 return; |
815 } | 500 } |
816 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 501 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
817 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); | 502 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
818 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], info.Ge
tIsolate())) { | |
819 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterface
Empty'."); | |
820 exceptionState.throwIfNeeded(); | |
821 return; | |
822 } | |
823 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::toNativeWithTypeCheck(info.GetIsolate(), info[1])); | 503 V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceE
mpty::toNativeWithTypeCheck(info.GetIsolate(), info[1])); |
824 ASSERT(impl); | 504 ASSERT(impl); |
825 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate())
; | 505 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate())
; |
826 RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod(
scriptContext, *impl, strArg, testInterfaceEmptyArg, exceptionState); | 506 RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod(
scriptContext, *impl, strArg, testInterfaceEmptyArg, exceptionState); |
827 if (exceptionState.throwIfNeeded()) | 507 if (exceptionState.throwIfNeeded()) |
828 return; | 508 return; |
829 v8SetReturnValue(info, result.release()); | 509 v8SetReturnValue(info, result.release()); |
830 } | 510 } |
831 | 511 |
832 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | 512 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) |
833 { | 513 { |
834 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 514 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
835 TestInterfaceImplementationV8Internal::implementsComplexMethodMethod(info); | 515 TestInterfaceV8Internal::implementsComplexMethodMethod(info); |
836 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 516 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
837 } | 517 } |
838 | 518 |
839 static void implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 519 static void implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
840 { | 520 { |
841 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 521 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
842 V8TestInterface::implementsCustomVoidMethodMethodCustom(info); | 522 V8TestInterface::implementsCustomVoidMethodMethodCustom(info); |
843 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 523 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
844 } | 524 } |
845 | 525 |
846 static void implementsStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::
Value>& info) | 526 static void implementsStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::
Value>& info) |
847 { | 527 { |
848 TestImplements::implementsStaticVoidMethod(); | 528 TestImplements::implementsStaticVoidMethod(); |
849 } | 529 } |
850 | 530 |
851 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) | 531 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackI
nfo<v8::Value>& info) |
852 { | 532 { |
853 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 533 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
854 TestInterfaceImplementationV8Internal::implementsStaticVoidMethodMethod(info
); | 534 TestInterfaceV8Internal::implementsStaticVoidMethodMethod(info); |
855 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 535 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
856 } | 536 } |
857 | 537 |
858 static void implements2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 538 #if ENABLE(CONDITION_PARTIAL) |
| 539 static void supplementalMethod1Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
859 { | 540 { |
860 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 541 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
861 ASSERT(impl); | 542 ASSERT(impl); |
862 TestImplements2Implementation::implements2VoidMethod(*impl); | 543 TestPartialInterface::supplementalMethod1(*impl); |
863 } | 544 } |
| 545 #endif // ENABLE(CONDITION_PARTIAL) |
864 | 546 |
865 static void implements2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 547 #if ENABLE(CONDITION_PARTIAL) |
| 548 static void supplementalMethod1MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
866 { | 549 { |
867 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 550 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
868 TestInterfaceImplementationV8Internal::implements2VoidMethodMethod(info); | 551 TestInterfaceV8Internal::supplementalMethod1Method(info); |
869 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 552 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
870 } | 553 } |
| 554 #endif // ENABLE(CONDITION_PARTIAL) |
871 | 555 |
872 static void implements3VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value
>& info) | 556 #if ENABLE(CONDITION_PARTIAL) |
| 557 static void supplementalMethod2Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
873 { | 558 { |
874 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 559 ExceptionState exceptionState(ExceptionState::ExecutionContext, "supplementa
lMethod2", "TestInterface", info.Holder(), info.GetIsolate()); |
875 impl->implements3VoidMethod(); | 560 if (UNLIKELY(info.Length() < 2)) { |
| 561 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, i
nfo.Length())); |
| 562 exceptionState.throwIfNeeded(); |
| 563 return; |
| 564 } |
| 565 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
| 566 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]); |
| 567 V8TRYCATCH_VOID(TestObject*, objArg, V8TestObject::toNativeWithTypeCheck(inf
o.GetIsolate(), info[1])); |
| 568 ASSERT(impl); |
| 569 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate())
; |
| 570 RefPtr<TestObject> result = TestPartialInterface::supplementalMethod2(script
Context, *impl, strArg, objArg, exceptionState); |
| 571 if (exceptionState.throwIfNeeded()) |
| 572 return; |
| 573 v8SetReturnValue(info, result.release()); |
876 } | 574 } |
| 575 #endif // ENABLE(CONDITION_PARTIAL) |
877 | 576 |
878 static void implements3VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v
8::Value>& info) | 577 #if ENABLE(CONDITION_PARTIAL) |
| 578 static void supplementalMethod2MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
879 { | 579 { |
880 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 580 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
881 TestInterfaceImplementationV8Internal::implements3VoidMethodMethod(info); | 581 TestInterfaceV8Internal::supplementalMethod2Method(info); |
882 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 582 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
883 } | 583 } |
| 584 #endif // ENABLE(CONDITION_PARTIAL) |
884 | 585 |
885 static void implements3StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8:
:Value>& info) | 586 #if ENABLE(CONDITION_PARTIAL) |
886 { | 587 static void supplementalMethod3MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
887 TestInterfaceImplementation::implements3StaticVoidMethod(); | |
888 } | |
889 | |
890 static void implements3StaticVoidMethodMethodCallback(const v8::FunctionCallback
Info<v8::Value>& info) | |
891 { | 588 { |
892 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 589 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
893 TestInterfaceImplementationV8Internal::implements3StaticVoidMethodMethod(inf
o); | 590 V8TestInterface::supplementalMethod3MethodCustom(info); |
894 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 591 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
895 } | 592 } |
| 593 #endif // ENABLE(CONDITION_PARTIAL) |
896 | 594 |
897 #if ENABLE(PARTIAL_CONDITION) | 595 #if ENABLE(CONDITION_PARTIAL) |
898 static void partialVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& i
nfo) | 596 static void supplementalMethod4Method(const v8::FunctionCallbackInfo<v8::Value>&
info) |
899 { | 597 { |
900 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 598 TestPartialInterface::supplementalMethod4(); |
901 ASSERT(impl); | |
902 TestPartialInterface::partialVoidMethod(*impl); | |
903 } | 599 } |
904 #endif // ENABLE(PARTIAL_CONDITION) | 600 #endif // ENABLE(CONDITION_PARTIAL) |
905 | 601 |
906 #if ENABLE(PARTIAL_CONDITION) | 602 #if ENABLE(CONDITION_PARTIAL) |
907 static void partialVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 603 static void supplementalMethod4MethodCallback(const v8::FunctionCallbackInfo<v8:
:Value>& info) |
908 { | 604 { |
909 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 605 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
910 TestInterfaceImplementationV8Internal::partialVoidMethodMethod(info); | 606 TestInterfaceV8Internal::supplementalMethod4Method(info); |
911 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 607 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
912 } | 608 } |
913 #endif // ENABLE(PARTIAL_CONDITION) | 609 #endif // ENABLE(CONDITION_PARTIAL) |
914 | 610 |
915 #if ENABLE(PARTIAL_CONDITION) | 611 static void constructor(const v8::FunctionCallbackInfo<v8::Value>& info) |
916 static void partialStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Val
ue>& info) | |
917 { | 612 { |
918 TestPartialInterface::partialStaticVoidMethod(); | 613 v8::Isolate* isolate = info.GetIsolate(); |
919 } | 614 ExceptionState exceptionState(ExceptionState::ConstructionContext, "TestInte
rface", info.Holder(), isolate); |
920 #endif // ENABLE(PARTIAL_CONDITION) | |
921 | |
922 #if ENABLE(PARTIAL_CONDITION) | |
923 static void partialStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo
<v8::Value>& info) | |
924 { | |
925 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
926 TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethod(info); | |
927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
928 } | |
929 #endif // ENABLE(PARTIAL_CONDITION) | |
930 | |
931 #if ENABLE(PARTIAL_CONDITION) | |
932 static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | |
933 { | |
934 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoid
MethodLongArg", "TestInterface", info.Holder(), info.GetIsolate()); | |
935 if (UNLIKELY(info.Length() < 1)) { | 615 if (UNLIKELY(info.Length() < 1)) { |
936 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); | 616 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, i
nfo.Length())); |
937 exceptionState.throwIfNeeded(); | 617 exceptionState.throwIfNeeded(); |
938 return; | 618 return; |
939 } | 619 } |
940 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 620 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str1, info[0]); |
941 V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), ex
ceptionState); | 621 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, str2, info[1]); |
942 ASSERT(impl); | 622 ExecutionContext* context = currentExecutionContext(isolate); |
943 TestPartialInterface::partialVoidMethodLongArg(*impl, longArg); | 623 RefPtr<TestInterface> impl = TestInterface::create(context, str1, str2, exce
ptionState); |
944 } | |
945 #endif // ENABLE(PARTIAL_CONDITION) | |
946 | |
947 #if ENABLE(PARTIAL_CONDITION) | |
948 static void partialVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | |
949 { | |
950 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
951 TestInterfaceImplementationV8Internal::partialVoidMethodLongArgMethod(info); | |
952 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
953 } | |
954 #endif // ENABLE(PARTIAL_CONDITION) | |
955 | |
956 #if ENABLE(PARTIAL_CONDITION) | |
957 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(const
v8::FunctionCallbackInfo<v8::Value>& info) | |
958 { | |
959 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialCall
WithExecutionContextRaisesExceptionVoidMethod", "TestInterface", info.Holder(),
info.GetIsolate()); | |
960 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
961 ASSERT(impl); | |
962 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate())
; | |
963 TestPartialInterface::partialCallWithExecutionContextRaisesExceptionVoidMeth
od(scriptContext, *impl, exceptionState); | |
964 if (exceptionState.throwIfNeeded()) | 624 if (exceptionState.throwIfNeeded()) |
965 return; | 625 return; |
966 } | |
967 #endif // ENABLE(PARTIAL_CONDITION) | |
968 | 626 |
969 #if ENABLE(PARTIAL_CONDITION) | 627 v8::Handle<v8::Object> wrapper = info.Holder(); |
970 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallba
ck(const v8::FunctionCallbackInfo<v8::Value>& info) | 628 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface>(impl.release(), &V
8TestInterface::wrapperTypeInfo, wrapper, isolate, WrapperConfiguration::Depende
nt); |
971 { | 629 v8SetReturnValue(info, wrapper); |
972 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
973 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaises
ExceptionVoidMethodMethod(info); | |
974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
975 } | |
976 #endif // ENABLE(PARTIAL_CONDITION) | |
977 | |
978 #if ENABLE(PARTIAL_CONDITION) | |
979 static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCall
backInfo<v8::Value>& info) | |
980 { | |
981 if (UNLIKELY(info.Length() < 1)) { | |
982 throwTypeError(ExceptionMessages::failedToExecute("partialVoidMethodPart
ialCallbackTypeArg", "TestInterface", ExceptionMessages::notEnoughArguments(1, i
nfo.Length())), info.GetIsolate()); | |
983 return; | |
984 } | |
985 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
986 V8TRYCATCH_VOID(ScriptValue, partialCallbackTypeArg, ScriptValue(info[0], in
fo.GetIsolate())); | |
987 ASSERT(impl); | |
988 TestPartialInterface::partialVoidMethodPartialCallbackTypeArg(*impl, partial
CallbackTypeArg); | |
989 } | |
990 #endif // ENABLE(PARTIAL_CONDITION) | |
991 | |
992 #if ENABLE(PARTIAL_CONDITION) | |
993 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::Func
tionCallbackInfo<v8::Value>& info) | |
994 { | |
995 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
996 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeA
rgMethod(info); | |
997 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
998 } | |
999 #endif // ENABLE(PARTIAL_CONDITION) | |
1000 | |
1001 static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | |
1002 { | |
1003 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
1004 ASSERT(impl); | |
1005 TestPartialInterfaceImplementation::partial2VoidMethod(*impl); | |
1006 } | |
1007 | |
1008 static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::
Value>& info) | |
1009 { | |
1010 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
1011 TestInterfaceImplementationV8Internal::partial2VoidMethodMethod(info); | |
1012 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1013 } | |
1014 | |
1015 static void partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | |
1016 { | |
1017 TestPartialInterfaceImplementation::partial2StaticVoidMethod(); | |
1018 } | |
1019 | |
1020 static void partial2StaticVoidMethodMethodCallback(const v8::FunctionCallbackInf
o<v8::Value>& info) | |
1021 { | |
1022 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | |
1023 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethod(info); | |
1024 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1025 } | |
1026 | |
1027 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
<v8::Value>& info) | |
1028 { | |
1029 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
1030 String result = impl->anonymousIndexedGetter(index); | |
1031 if (result.isNull()) | |
1032 return; | |
1033 v8SetReturnValueString(info, result, info.GetIsolate()); | |
1034 } | |
1035 | |
1036 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
backInfo<v8::Value>& info) | |
1037 { | |
1038 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | |
1039 TestInterfaceImplementationV8Internal::indexedPropertyGetter(index, info); | |
1040 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1041 } | |
1042 | |
1043 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value,
const v8::PropertyCallbackInfo<v8::Value>& info) | |
1044 { | |
1045 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
1046 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, v8Va
lue); | |
1047 bool result = impl->anonymousIndexedSetter(index, propertyValue); | |
1048 if (!result) | |
1049 return; | |
1050 v8SetReturnValue(info, v8Value); | |
1051 } | |
1052 | |
1053 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v
8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | |
1054 { | |
1055 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | |
1056 TestInterfaceImplementationV8Internal::indexedPropertySetter(index, v8Value,
info); | |
1057 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1058 } | |
1059 | |
1060 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf
o<v8::Boolean>& info) | |
1061 { | |
1062 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
1063 DeleteResult result = impl->anonymousIndexedDeleter(index); | |
1064 if (result != DeleteUnknownProperty) | |
1065 return v8SetReturnValueBool(info, result == DeleteSuccess); | |
1066 } | |
1067 | |
1068 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCal
lbackInfo<v8::Boolean>& info) | |
1069 { | |
1070 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty"); | |
1071 TestInterfaceImplementationV8Internal::indexedPropertyDeleter(index, info); | |
1072 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1073 } | 630 } |
1074 | 631 |
1075 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) | 632 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCa
llbackInfo<v8::Value>& info) |
1076 { | 633 { |
1077 if (info.Holder()->HasRealNamedProperty(name)) | 634 if (info.Holder()->HasRealNamedProperty(name)) |
1078 return; | 635 return; |
1079 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | 636 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) |
1080 return; | 637 return; |
1081 | 638 |
1082 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 639 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
1083 AtomicString propertyName = toCoreAtomicString(name); | 640 AtomicString propertyName = toCoreAtomicString(name); |
1084 String result = impl->anonymousNamedGetter(propertyName); | 641 bool result0Enabled = false; |
1085 if (result.isNull()) | 642 RefPtr<Node> result0; |
| 643 bool result1Enabled = false; |
| 644 RefPtr<NodeList> result1; |
| 645 impl->getItem(propertyName, result0Enabled, result0, result1Enabled, result1
); |
| 646 if (!result0Enabled && !result1Enabled) |
1086 return; | 647 return; |
1087 v8SetReturnValueString(info, result, info.GetIsolate()); | 648 if (result0Enabled) { |
| 649 v8SetReturnValueFast(info, WTF::getPtr(result0.release()), impl); |
| 650 return; |
| 651 } |
| 652 if (result1Enabled) { |
| 653 v8SetReturnValueFast(info, WTF::getPtr(result1.release()), impl); |
| 654 return; |
| 655 } |
| 656 v8SetReturnValueNull(info); |
1088 } | 657 } |
1089 | 658 |
1090 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 659 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
1091 { | 660 { |
1092 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 661 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
1093 TestInterfaceImplementationV8Internal::namedPropertyGetter(name, info); | 662 TestInterfaceV8Internal::namedPropertyGetter(name, info); |
1094 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 663 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1095 } | 664 } |
1096 | 665 |
1097 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value>
v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | |
1098 { | |
1099 if (info.Holder()->HasRealNamedProperty(name)) | |
1100 return; | |
1101 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty()) | |
1102 return; | |
1103 | |
1104 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
1105 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyName, name)
; | |
1106 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, propertyValue, v8Va
lue); | |
1107 bool result = impl->anonymousNamedSetter(propertyName, propertyValue); | |
1108 if (!result) | |
1109 return; | |
1110 v8SetReturnValue(info, v8Value); | |
1111 } | |
1112 | |
1113 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) | 666 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8
::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) |
1114 { | 667 { |
1115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 668 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
1116 TestInterfaceImplementationV8Internal::namedPropertySetter(name, v8Value, in
fo); | 669 V8TestInterface::namedPropertySetterCustom(name, v8Value, info); |
1117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 670 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1118 } | 671 } |
1119 | 672 |
1120 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) | 673 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCal
lbackInfo<v8::Integer>& info) |
1121 { | 674 { |
1122 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 675 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
1123 AtomicString propertyName = toCoreAtomicString(name); | 676 AtomicString propertyName = toCoreAtomicString(name); |
1124 v8::String::Utf8Value namedProperty(name); | 677 v8::String::Utf8Value namedProperty(name); |
1125 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface", info.Holder(), info.GetIsolate()); | 678 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty,
"TestInterface", info.Holder(), info.GetIsolate()); |
1126 bool result = impl->namedPropertyQuery(propertyName, exceptionState); | 679 bool result = impl->namedPropertyQuery(propertyName, exceptionState); |
1127 if (exceptionState.throwIfNeeded()) | 680 if (exceptionState.throwIfNeeded()) |
1128 return; | 681 return; |
1129 if (!result) | 682 if (!result) |
1130 return; | 683 return; |
1131 v8SetReturnValueInt(info, v8::None); | 684 v8SetReturnValueInt(info, v8::None); |
1132 } | 685 } |
1133 | 686 |
1134 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) | 687 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::Pro
pertyCallbackInfo<v8::Integer>& info) |
1135 { | 688 { |
1136 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 689 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
1137 TestInterfaceImplementationV8Internal::namedPropertyQuery(name, info); | 690 TestInterfaceV8Internal::namedPropertyQuery(name, info); |
1138 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | |
1139 } | |
1140 | |
1141 static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyC
allbackInfo<v8::Boolean>& info) | |
1142 { | |
1143 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | |
1144 AtomicString propertyName = toCoreAtomicString(name); | |
1145 DeleteResult result = impl->anonymousNamedDeleter(propertyName); | |
1146 if (result != DeleteUnknownProperty) | |
1147 return v8SetReturnValueBool(info, result == DeleteSuccess); | |
1148 } | |
1149 | |
1150 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::P
ropertyCallbackInfo<v8::Boolean>& info) | |
1151 { | |
1152 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | |
1153 TestInterfaceImplementationV8Internal::namedPropertyDeleter(name, info); | |
1154 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 691 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1155 } | 692 } |
1156 | 693 |
1157 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) | 694 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i
nfo) |
1158 { | 695 { |
1159 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
; | 696 TestInterface* impl = V8TestInterface::toNative(info.Holder()); |
1160 v8::Isolate* isolate = info.GetIsolate(); | 697 v8::Isolate* isolate = info.GetIsolate(); |
1161 Vector<String> names; | 698 Vector<String> names; |
1162 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter
face", info.Holder(), isolate); | 699 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInter
face", info.Holder(), isolate); |
1163 impl->namedPropertyEnumerator(names, exceptionState); | 700 impl->namedPropertyEnumerator(names, exceptionState); |
1164 if (exceptionState.throwIfNeeded()) | 701 if (exceptionState.throwIfNeeded()) |
1165 return; | 702 return; |
1166 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size()); | 703 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size()); |
1167 for (size_t i = 0; i < names.size(); ++i) | 704 for (size_t i = 0; i < names.size(); ++i) |
1168 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i])); | 705 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i])); |
1169 v8SetReturnValue(info, v8names); | 706 v8SetReturnValue(info, v8names); |
1170 } | 707 } |
1171 | 708 |
1172 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) | 709 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::A
rray>& info) |
1173 { | 710 { |
1174 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); | 711 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty"); |
1175 TestInterfaceImplementationV8Internal::namedPropertyEnumerator(info); | 712 TestInterfaceV8Internal::namedPropertyEnumerator(info); |
1176 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); | 713 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution"); |
1177 } | 714 } |
1178 | 715 |
1179 } // namespace TestInterfaceImplementationV8Internal | 716 } // namespace TestInterfaceV8Internal |
1180 | 717 |
1181 void V8TestInterface::visitDOMWrapper(void* object, const v8::Persistent<v8::Obj
ect>& wrapper, v8::Isolate* isolate) | 718 void V8TestInterface::visitDOMWrapper(void* object, const v8::Persistent<v8::Obj
ect>& wrapper, v8::Isolate* isolate) |
1182 { | 719 { |
1183 TestInterfaceImplementation* impl = fromInternalPointer(object); | 720 TestInterface* impl = fromInternalPointer(object); |
1184 v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate,
wrapper); | 721 v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate,
wrapper); |
1185 V8WrapperInstantiationScope scope(creationContext, isolate); | 722 V8WrapperInstantiationScope scope(creationContext, isolate); |
1186 TestInterfaceImplementation* referencedName = impl->referencedName(); | 723 TestObject* referencedName = impl->referencedName(); |
1187 if (referencedName) { | 724 if (referencedName) { |
1188 if (!DOMDataStore::containsWrapper<V8TestInterface>(referencedName, isol
ate)) | 725 if (!DOMDataStore::containsWrapper<V8TestObject>(referencedName, isolate
)) |
1189 wrap(referencedName, creationContext, isolate); | 726 wrap(referencedName, creationContext, isolate); |
1190 DOMDataStore::setWrapperReference<V8TestInterface>(wrapper, referencedNa
me, isolate); | 727 DOMDataStore::setWrapperReference<V8TestObject>(wrapper, referencedName,
isolate); |
1191 } | 728 } |
1192 setObjectGroup(object, wrapper, isolate); | 729 setObjectGroup(object, wrapper, isolate); |
1193 } | 730 } |
1194 | 731 |
1195 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttribute
s[] = { | 732 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttribute
s[] = { |
1196 {"testInterfaceAttribute", TestInterfaceImplementationV8Internal::testInterf
aceAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::test
InterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessContro
l>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}, | 733 {"implementsReadonlyStringAttribute", TestInterfaceV8Internal::implementsRea
donlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessC
ontrol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on inst
ance */}, |
1197 {"testImplementedAsConstructorAttribute", TestInterfaceImplementationV8Inter
nal::TestInterfaceImplementationConstructorGetter, TestInterfaceImplementationV8
Internal::TestInterfaceImplementationReplaceableAttributeSetterCallback, 0, 0, c
onst_cast<WrapperTypeInfo*>(&V8TestImplementedAs::wrapperTypeInfo), static_cast<
v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum
), 0 /* on instance */}, | 734 {"implementsStringAttribute", TestInterfaceV8Internal::implementsStringAttri
buteAttributeGetterCallback, TestInterfaceV8Internal::implementsStringAttributeA
ttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), st
atic_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
1198 {"perWorldBindingsStringAttribute", TestInterfaceImplementationV8Internal::p
erWorldBindingsStringAttributeAttributeGetterCallback, TestInterfaceImplementati
onV8Internal::perWorldBindingsStringAttributeAttributeSetterCallback, TestInterf
aceImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetterCallb
ackForMainWorld, TestInterfaceImplementationV8Internal::perWorldBindingsStringAt
tributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8
::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, | 735 {"implementsNodeAttribute", TestInterfaceV8Internal::implementsNodeAttribute
AttributeGetterCallback, TestInterfaceV8Internal::implementsNodeAttributeAttribu
teSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_c
ast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
1199 {"implementsReadonlyStringAttribute", TestInterfaceImplementationV8Internal:
:implementsReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_ca
st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)
, 0 /* on instance */}, | 736 {"implementsEventHandlerAttribute", TestInterfaceV8Internal::implementsEvent
HandlerAttributeAttributeGetterCallback, TestInterfaceV8Internal::implementsEven
tHandlerAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl
>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance *
/}, |
1200 {"implementsStringAttribute", TestInterfaceImplementationV8Internal::impleme
ntsStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal
::implementsStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::Acc
essControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on
instance */}, | 737 #if ENABLE(CONDITION_PARTIAL) |
1201 {"implementsNodeAttribute", TestInterfaceImplementationV8Internal::implement
sNodeAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::im
plementsNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessCon
trol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instan
ce */}, | 738 {"supplementalStr1", TestInterfaceV8Internal::supplementalStr1AttributeGette
rCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<
v8::PropertyAttribute>(v8::None), 0 /* on instance */}, |
1202 {"implementsEventHandlerAttribute", TestInterfaceImplementationV8Internal::i
mplementsEventHandlerAttributeAttributeGetterCallback, TestInterfaceImplementati
onV8Internal::implementsEventHandlerAttributeAttributeSetterCallback, 0, 0, 0, s
tatic_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v
8::None), 0 /* on instance */}, | 739 #endif // ENABLE(CONDITION_PARTIAL) |
1203 {"implements3StringAttribute", TestInterfaceImplementationV8Internal::implem
ents3StringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Intern
al::implements3StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::
AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /*
on instance */}, | 740 #if ENABLE(CONDITION_PARTIAL) |
| 741 {"supplementalStr2", TestInterfaceV8Internal::supplementalStr2AttributeGette
rCallback, TestInterfaceV8Internal::supplementalStr2AttributeSetterCallback, 0,
0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, |
| 742 #endif // ENABLE(CONDITION_PARTIAL) |
| 743 #if ENABLE(CONDITION_PARTIAL) |
| 744 {"supplementalNode", TestInterfaceV8Internal::supplementalNodeAttributeGette
rCallback, TestInterfaceV8Internal::supplementalNodeAttributeSetterCallback, 0,
0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttri
bute>(v8::None), 0 /* on instance */}, |
| 745 #endif // ENABLE(CONDITION_PARTIAL) |
1204 }; | 746 }; |
1205 | 747 |
1206 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] =
{ | 748 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] =
{ |
1207 {"voidMethodTestInterfaceEmptyArg", TestInterfaceImplementationV8Internal::v
oidMethodTestInterfaceEmptyArgMethodCallback, 0, 1}, | 749 {"namedItem", TestInterfaceV8Internal::namedItemMethodCallback, 0, 1}, |
1208 {"voidMethod", TestInterfaceImplementationV8Internal::voidMethodMethodCallba
ck, TestInterfaceImplementationV8Internal::voidMethodMethodCallbackForMainWorld,
0}, | 750 {"implementsVoidMethod", TestInterfaceV8Internal::implementsVoidMethodMethod
Callback, 0, 0}, |
1209 {"implementsVoidMethod", TestInterfaceImplementationV8Internal::implementsVo
idMethodMethodCallback, 0, 0}, | 751 {"implementsComplexMethod", TestInterfaceV8Internal::implementsComplexMethod
MethodCallback, 0, 2}, |
1210 {"implementsComplexMethod", TestInterfaceImplementationV8Internal::implement
sComplexMethodMethodCallback, 0, 2}, | 752 {"implementsCustomVoidMethod", TestInterfaceV8Internal::implementsCustomVoid
MethodMethodCallback, 0, 0}, |
1211 {"implementsCustomVoidMethod", TestInterfaceImplementationV8Internal::implem
entsCustomVoidMethodMethodCallback, 0, 0}, | 753 #if ENABLE(CONDITION_PARTIAL) |
1212 {"implements3VoidMethod", TestInterfaceImplementationV8Internal::implements3
VoidMethodMethodCallback, 0, 0}, | 754 {"supplementalMethod1", TestInterfaceV8Internal::supplementalMethod1MethodCa
llback, 0, 0}, |
| 755 #endif // ENABLE(CONDITION_PARTIAL) |
| 756 #if ENABLE(CONDITION_PARTIAL) |
| 757 {"supplementalMethod2", TestInterfaceV8Internal::supplementalMethod2MethodCa
llback, 0, 2}, |
| 758 #endif // ENABLE(CONDITION_PARTIAL) |
| 759 #if ENABLE(CONDITION_PARTIAL) |
| 760 {"supplementalMethod3", TestInterfaceV8Internal::supplementalMethod3MethodCa
llback, 0, 0}, |
| 761 #endif // ENABLE(CONDITION_PARTIAL) |
1213 }; | 762 }; |
1214 | 763 |
| 764 void V8TestInterface::constructorCallback(const v8::FunctionCallbackInfo<v8::Val
ue>& info) |
| 765 { |
| 766 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "DOMConstructor"); |
| 767 if (!info.IsConstructCall()) { |
| 768 throwTypeError(ExceptionMessages::constructorNotCallableAsFunction("Test
Interface"), info.GetIsolate()); |
| 769 return; |
| 770 } |
| 771 |
| 772 if (ConstructorMode::current() == ConstructorMode::WrapExistingObject) { |
| 773 v8SetReturnValue(info, info.Holder()); |
| 774 return; |
| 775 } |
| 776 |
| 777 TestInterfaceV8Internal::constructor(info); |
| 778 } |
| 779 |
1215 static void configureV8TestInterfaceTemplate(v8::Handle<v8::FunctionTemplate> fu
nctionTemplate, v8::Isolate* isolate) | 780 static void configureV8TestInterfaceTemplate(v8::Handle<v8::FunctionTemplate> fu
nctionTemplate, v8::Isolate* isolate) |
1216 { | 781 { |
1217 functionTemplate->ReadOnlyPrototype(); | 782 functionTemplate->ReadOnlyPrototype(); |
1218 | 783 |
1219 v8::Local<v8::Signature> defaultSignature; | 784 v8::Local<v8::Signature> defaultSignature; |
1220 if (!RuntimeEnabledFeatures::featureNameEnabled()) | 785 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTempl
ate, "TestInterface", v8::Local<v8::FunctionTemplate>(), V8TestInterface::intern
alFieldCount, |
1221 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterface::intern
alFieldCount, 0, 0, 0, 0, 0, 0, isolate); | 786 V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttributes), |
1222 else | 787 0, 0, |
1223 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionT
emplate, "TestInterface", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInte
rface::internalFieldCount, | 788 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), |
1224 V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttribute
s), | 789 isolate); |
1225 0, 0, | 790 functionTemplate->SetCallHandler(V8TestInterface::constructorCallback); |
1226 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods), | 791 functionTemplate->SetLength(1); |
1227 isolate); | |
1228 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); | 792 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTempla
te->InstanceTemplate(); |
1229 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); | 793 v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTempl
ate->PrototypeTemplate(); |
1230 if (RuntimeEnabledFeatures::implementsFeatureNameEnabled()) { | 794 if (RuntimeEnabledFeatures::implementsFeatureNameEnabled()) { |
1231 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 795 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
1232 {"implementsRuntimeEnabledNodeAttribute", TestInterfaceImplementationV8I
nternal::implementsRuntimeEnabledNodeAttributeAttributeGetterCallback, TestInter
faceImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSett
erCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8
::PropertyAttribute>(v8::None), 0 /* on instance */}; | 796 {"implementsRuntimeEnabledNodeAttribute", TestInterfaceV8Internal::imple
mentsRuntimeEnabledNodeAttributeAttributeGetterCallback, TestInterfaceV8Internal
::implementsRuntimeEnabledNodeAttributeAttributeSetterCallback, 0, 0, 0, static_
cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::Non
e), 0 /* on instance */}; |
1233 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 797 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
1234 } | 798 } |
1235 if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) { | 799 #if ENABLE(CONDITION_PARTIAL) |
| 800 if (RuntimeEnabledFeatures::condition13Enabled()) { |
1236 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 801 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
1237 {"implements2StringAttribute", TestInterfaceImplementationV8Internal::im
plements2StringAttributeAttributeGetterCallback, TestInterfaceImplementationV8In
ternal::implements2StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<
v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0
/* on instance */}; | 802 {"Node13", TestInterfaceV8Internal::Node13AttributeGetterCallback, TestI
nterfaceV8Internal::Node13AttributeSetterCallback, 0, 0, 0, static_cast<v8::Acce
ssControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on i
nstance */}; |
1238 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 803 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
1239 } | 804 } |
1240 #if ENABLE(PARTIAL_CONDITION) | 805 #endif // ENABLE(CONDITION_PARTIAL) |
1241 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { | |
1242 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | |
1243 {"partialLongAttribute", TestInterfaceImplementationV8Internal::partialL
ongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::part
ialLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>
(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */
}; | |
1244 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | |
1245 } | |
1246 #endif // ENABLE(PARTIAL_CONDITION) | |
1247 #if ENABLE(PARTIAL_CONDITION) | |
1248 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { | |
1249 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | |
1250 {"partialCallWithExecutionContextLongAttribute", TestInterfaceImplementa
tionV8Internal::partialCallWithExecutionContextLongAttributeAttributeGetterCallb
ack, TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongA
ttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEF
AULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; | |
1251 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | |
1252 } | |
1253 #endif // ENABLE(PARTIAL_CONDITION) | |
1254 #if ENABLE(PARTIAL_CONDITION) | |
1255 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { | |
1256 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | |
1257 {"partialPartialEnumTypeAttribute", TestInterfaceImplementationV8Interna
l::partialPartialEnumTypeAttributeAttributeGetterCallback, TestInterfaceImplemen
tationV8Internal::partialPartialEnumTypeAttributeAttributeSetterCallback, 0, 0,
0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribut
e>(v8::None), 0 /* on instance */}; | |
1258 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | |
1259 } | |
1260 #endif // ENABLE(PARTIAL_CONDITION) | |
1261 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta
nts[] = { | 806 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConsta
nts[] = { |
1262 {"UNSIGNED_LONG", 0}, | |
1263 {"CONST_JAVASCRIPT", 1}, | |
1264 {"IMPLEMENTS_CONSTANT_1", 1}, | 807 {"IMPLEMENTS_CONSTANT_1", 1}, |
1265 {"IMPLEMENTS_CONSTANT_2", 2}, | 808 {"IMPLEMENTS_CONSTANT_2", 2}, |
1266 {"PARTIAL2_UNSIGNED_SHORT", 0}, | 809 {"SUPPLEMENTALCONSTANT1", 1}, |
| 810 {"SUPPLEMENTALCONSTANT2", 2}, |
1267 }; | 811 }; |
1268 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); | 812 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); |
1269 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { | 813 COMPILE_ASSERT(1 == TestImplements::IMPLEMENTS_CONSTANT_1, TheValueOfTestInt
erface_IMPLEMENTS_CONSTANT_1DoesntMatchWithImplementation); |
1270 static const V8DOMConfiguration::ConstantConfiguration constantConfigura
tion = {"PARTIAL_UNSIGNED_SHORT", static_cast<signed int>(0)}; | 814 COMPILE_ASSERT(2 == TestImplements::IMPLEMENTS_REFLECT_CONSTANT, TheValueOfT
estInterface_IMPLEMENTS_REFLECT_CONSTANTDoesntMatchWithImplementation); |
1271 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate
, &constantConfiguration, 1, isolate); | 815 COMPILE_ASSERT(1 == TestPartialInterface::SUPPLEMENTALCONSTANT1, TheValueOfT
estInterface_SUPPLEMENTALCONSTANT1DoesntMatchWithImplementation); |
1272 } | 816 COMPILE_ASSERT(2 == TestPartialInterface::CONST_IMPL, TheValueOfTestInterfac
e_CONST_IMPLDoesntMatchWithImplementation); |
1273 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterfac
eImplementationV8Internal::indexedPropertyGetterCallback, TestInterfaceImplement
ationV8Internal::indexedPropertySetterCallback, 0, TestInterfaceImplementationV8
Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterfac
eImplementation>); | 817 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceV
8Internal::namedPropertyGetterCallback, TestInterfaceV8Internal::namedPropertySe
tterCallback, TestInterfaceV8Internal::namedPropertyQueryCallback, 0, TestInterf
aceV8Internal::namedPropertyEnumeratorCallback); |
1274 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceI
mplementationV8Internal::namedPropertyGetterCallback, TestInterfaceImplementatio
nV8Internal::namedPropertySetterCallback, TestInterfaceImplementationV8Internal:
:namedPropertyQueryCallback, TestInterfaceImplementationV8Internal::namedPropert
yDeleterCallback, TestInterfaceImplementationV8Internal::namedPropertyEnumerator
Callback); | 818 functionTemplate->Set(v8AtomicString(isolate, "implementsStaticVoidMethod"),
v8::FunctionTemplate::New(isolate, TestInterfaceV8Internal::implementsStaticVoi
dMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
1275 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
ce::legacyCallCustom); | 819 #if ENABLE(CONDITION_PARTIAL) |
1276 functionTemplate->Set(v8AtomicString(isolate, "implementsStaticVoidMethod"),
v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::imple
mentsStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(),
0)); | 820 functionTemplate->Set(v8AtomicString(isolate, "supplementalMethod4"), v8::Fu
nctionTemplate::New(isolate, TestInterfaceV8Internal::supplementalMethod4MethodC
allback, v8Undefined(), v8::Local<v8::Signature>(), 0)); |
1277 if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) | 821 #endif // ENABLE(CONDITION_PARTIAL) |
1278 prototypeTemplate->Set(v8AtomicString(isolate, "implements2VoidMethod"),
v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::imple
ments2VoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)); | 822 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticReadOnlyLongAttribute"), TestInterfaceV8Internal::implementsStaticReadOnlyL
ongAttributeAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_ca
st<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static
_cast<v8::AccessControl>(v8::DEFAULT)); |
1279 functionTemplate->Set(v8AtomicString(isolate, "implements3StaticVoidMethod")
, v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::impl
ements3StaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>()
, 0)); | 823 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticStringAttribute"), TestInterfaceV8Internal::implementsStaticStringAttribute
AttributeGetterCallback, TestInterfaceV8Internal::implementsStaticStringAttribut
eAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::Propert
yAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Acce
ssControl>(v8::DEFAULT)); |
1280 #if ENABLE(PARTIAL_CONDITION) | 824 #if ENABLE(CONDITION_PARTIAL) |
1281 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) | 825 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "supplementa
lStaticReadOnlyAttr"), TestInterfaceV8Internal::supplementalStaticReadOnlyAttrAt
tributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::Propert
yAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Acce
ssControl>(v8::DEFAULT)); |
1282 prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethod"), v8:
:FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partialVo
idMethodMethodCallback, v8Undefined(), defaultSignature, 0)); | 826 #endif // ENABLE(CONDITION_PARTIAL) |
1283 #endif // ENABLE(PARTIAL_CONDITION) | 827 #if ENABLE(CONDITION_PARTIAL) |
1284 #if ENABLE(PARTIAL_CONDITION) | 828 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "supplementa
lStaticAttr"), TestInterfaceV8Internal::supplementalStaticAttrAttributeGetterCal
lback, TestInterfaceV8Internal::supplementalStaticAttrAttributeSetterCallback, v
8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::
Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); |
1285 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) | 829 #endif // ENABLE(CONDITION_PARTIAL) |
1286 functionTemplate->Set(v8AtomicString(isolate, "partialStaticVoidMethod")
, v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::part
ialStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)
); | |
1287 #endif // ENABLE(PARTIAL_CONDITION) | |
1288 #if ENABLE(PARTIAL_CONDITION) | |
1289 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) | |
1290 prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethodLongArg
"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::pa
rtialVoidMethodLongArgMethodCallback, v8Undefined(), defaultSignature, 1)); | |
1291 #endif // ENABLE(PARTIAL_CONDITION) | |
1292 #if ENABLE(PARTIAL_CONDITION) | |
1293 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) | |
1294 prototypeTemplate->Set(v8AtomicString(isolate, "partialCallWithExecution
ContextRaisesExceptionVoidMethod"), v8::FunctionTemplate::New(isolate, TestInter
faceImplementationV8Internal::partialCallWithExecutionContextRaisesExceptionVoid
MethodMethodCallback, v8Undefined(), defaultSignature, 0)); | |
1295 #endif // ENABLE(PARTIAL_CONDITION) | |
1296 #if ENABLE(PARTIAL_CONDITION) | |
1297 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) | |
1298 prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethodPartial
CallbackTypeArg"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementatio
nV8Internal::partialVoidMethodPartialCallbackTypeArgMethodCallback, v8Undefined(
), defaultSignature, 1)); | |
1299 #endif // ENABLE(PARTIAL_CONDITION) | |
1300 functionTemplate->Set(v8AtomicString(isolate, "partial2StaticVoidMethod"), v
8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partial
2StaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0)); | |
1301 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStrin
gAttribute"), TestInterfaceImplementationV8Internal::staticStringAttributeAttrib
uteGetterCallback, TestInterfaceImplementationV8Internal::staticStringAttributeA
ttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyA
ttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::Access
Control>(v8::DEFAULT)); | |
1302 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticReadOnlyLongAttribute"), TestInterfaceImplementationV8Internal::implementsS
taticReadOnlyLongAttributeAttributeGetterCallback, 0, v8::External::New(isolate,
0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignat
ure>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | |
1303 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsS
taticStringAttribute"), TestInterfaceImplementationV8Internal::implementsStaticS
tringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::im
plementsStaticStringAttributeAttributeSetterCallback, v8::External::New(isolate,
0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignat
ure>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | |
1304 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements2
StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements2Stati
cStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::
implements2StaticStringAttributeAttributeSetterCallback, v8::External::New(isola
te, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSig
nature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | |
1305 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements3
StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements3Stati
cStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::
implements3StaticStringAttributeAttributeSetterCallback, v8::External::New(isola
te, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSig
nature>(), static_cast<v8::AccessControl>(v8::DEFAULT)); | |
1306 #if ENABLE(PARTIAL_CONDITION) | |
1307 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "partialStat
icLongAttribute"), TestInterfaceImplementationV8Internal::partialStaticLongAttri
buteAttributeGetterCallback, TestInterfaceImplementationV8Internal::partialStati
cLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cas
t<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_
cast<v8::AccessControl>(v8::DEFAULT)); | |
1308 #endif // ENABLE(PARTIAL_CONDITION) | |
1309 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "partial2Sta
ticLongAttribute"), TestInterfaceImplementationV8Internal::partial2StaticLongAtt
ributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partial2St
aticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_
cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), stat
ic_cast<v8::AccessControl>(v8::DEFAULT)); | |
1310 | 830 |
1311 // Custom toString template | 831 // Custom toString template |
1312 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); | 832 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData:
:current()->toStringTemplate()); |
1313 } | 833 } |
1314 | 834 |
1315 v8::Handle<v8::FunctionTemplate> V8TestInterface::domTemplate(v8::Isolate* isola
te) | 835 v8::Handle<v8::FunctionTemplate> V8TestInterface::domTemplate(v8::Isolate* isola
te) |
1316 { | 836 { |
1317 V8PerIsolateData* data = V8PerIsolateData::from(isolate); | 837 V8PerIsolateData* data = V8PerIsolateData::from(isolate); |
1318 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); | 838 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cas
t<WrapperTypeInfo*>(&wrapperTypeInfo)); |
1319 if (!result.IsEmpty()) | 839 if (!result.IsEmpty()) |
1320 return result; | 840 return result; |
1321 | 841 |
1322 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); | 842 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate"); |
1323 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); | 843 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidCons
tructorMode); |
1324 configureV8TestInterfaceTemplate(result, isolate); | 844 configureV8TestInterfaceTemplate(result, isolate); |
1325 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; | 845 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result)
; |
1326 return result; | 846 return result; |
1327 } | 847 } |
1328 | 848 |
1329 bool V8TestInterface::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* is
olate) | 849 bool V8TestInterface::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* is
olate) |
1330 { | 850 { |
1331 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); | 851 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Valu
e); |
1332 } | 852 } |
1333 | 853 |
1334 v8::Handle<v8::Object> V8TestInterface::findInstanceInPrototypeChain(v8::Handle<
v8::Value> v8Value, v8::Isolate* isolate) | 854 v8::Handle<v8::Object> V8TestInterface::findInstanceInPrototypeChain(v8::Handle<
v8::Value> v8Value, v8::Isolate* isolate) |
1335 { | 855 { |
1336 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); | 856 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrappe
rTypeInfo, v8Value); |
1337 } | 857 } |
1338 | 858 |
1339 TestInterfaceImplementation* V8TestInterface::toNativeWithTypeCheck(v8::Isolate*
isolate, v8::Handle<v8::Value> value) | 859 TestInterface* V8TestInterface::toNativeWithTypeCheck(v8::Isolate* isolate, v8::
Handle<v8::Value> value) |
1340 { | 860 { |
1341 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; | 861 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Obje
ct>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) :
0; |
1342 } | 862 } |
1343 | 863 |
1344 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object>
instanceTemplate, TestInterfaceImplementation* impl, v8::Isolate* isolate) | 864 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object>
instanceTemplate, TestInterface* impl, v8::Isolate* isolate) |
1345 { | 865 { |
1346 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); | 866 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instan
ceTemplate->GetPrototype()); |
1347 if (ContextFeatures::implementsContextNameEnabled(impl->document())) { | 867 if (ContextFeatures::implementsContextNameEnabled(impl->document())) { |
1348 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | 868 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ |
1349 {"implementsPerContextEnabledNodeAttribute", TestInterfaceImplementation
V8Internal::implementsPerContextEnabledNodeAttributeAttributeGetterCallback, Tes
tInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttr
ibuteSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), stati
c_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */}; | 869 {"implementsPerContextEnabledNodeAttribute", TestInterfaceV8Internal::im
plementsPerContextEnabledNodeAttributeAttributeGetterCallback, TestInterfaceV8In
ternal::implementsPerContextEnabledNodeAttributeAttributeSetterCallback, 0, 0, 0
, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute
>(v8::None), 0 /* on instance */}; |
1350 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | 870 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); |
1351 } | 871 } |
1352 if (ContextFeatures::partialContextNameEnabled(impl->document())) { | |
1353 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | |
1354 {"partial2LongAttribute", TestInterfaceImplementationV8Internal::partial
2LongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::pa
rtial2LongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessContr
ol>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance
*/}; | |
1355 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | |
1356 } | |
1357 if (ContextFeatures::partialContextNameEnabled(impl->document())) { | |
1358 static const V8DOMConfiguration::AttributeConfiguration attributeConfigu
ration =\ | |
1359 {"partial2StaticLongAttribute", TestInterfaceImplementationV8Internal::p
artial2StaticLongAttributeAttributeGetterCallback, TestInterfaceImplementationV8
Internal::partial2StaticLongAttributeAttributeSetterCallback, 0, 0, 0, static_ca
st<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None)
, 0 /* on instance */}; | |
1360 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate
, attributeConfiguration, isolate); | |
1361 } | |
1362 } | |
1363 | |
1364 void V8TestInterface::installPerContextEnabledMethods(v8::Handle<v8::Object> pro
totypeTemplate, v8::Isolate* isolate) | |
1365 { | |
1366 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domT
emplate(isolate)); | |
1367 | |
1368 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationCo
ntext()); | |
1369 if (context && context->isDocument() && ContextFeatures::partialContextNameE
nabled(toDocument(context))) | |
1370 prototypeTemplate->Set(v8AtomicString(isolate, "partial2VoidMethod"), v8
::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partial2
VoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction()); | |
1371 if (context && context->isDocument() && ContextFeatures::partialContextNameE
nabled(toDocument(context))) | |
1372 prototypeTemplate->Set(v8AtomicString(isolate, "partial2StaticVoidMethod
"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::pa
rtial2StaticVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFu
nction()); | |
1373 } | 872 } |
1374 | 873 |
1375 ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> wrapp
er) | 874 ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> wrapp
er) |
1376 { | 875 { |
1377 return toNative(wrapper); | 876 return toNative(wrapper); |
1378 } | 877 } |
1379 | 878 |
| 879 v8::Handle<v8::Object> V8TestInterface::createWrapper(PassRefPtr<TestInterface>
impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate) |
| 880 { |
| 881 ASSERT(impl); |
| 882 ASSERT(!DOMDataStore::containsWrapper<V8TestInterface>(impl.get(), isolate))
; |
| 883 if (ScriptWrappable::wrapperCanBeStoredInObject(impl.get())) { |
| 884 const WrapperTypeInfo* actualInfo = ScriptWrappable::getTypeInfoFromObje
ct(impl.get()); |
| 885 // Might be a XXXConstructor::wrapperTypeInfo instead of an XXX::wrapper
TypeInfo. These will both have |
| 886 // the same object de-ref functions, though, so use that as the basis of
the check. |
| 887 RELEASE_ASSERT_WITH_SECURITY_IMPLICATION(actualInfo->derefObjectFunction
== wrapperTypeInfo.derefObjectFunction); |
| 888 } |
| 889 |
| 890 v8::Handle<v8::Object> wrapper = V8DOMWrapper::createWrapper(creationContext
, &wrapperTypeInfo, toInternalPointer(impl.get()), isolate); |
| 891 if (UNLIKELY(wrapper.IsEmpty())) |
| 892 return wrapper; |
| 893 |
| 894 installPerContextEnabledProperties(wrapper, impl.get(), isolate); |
| 895 V8DOMWrapper::associateObjectWithWrapper<V8TestInterface>(impl, &wrapperType
Info, wrapper, isolate, WrapperConfiguration::Dependent); |
| 896 return wrapper; |
| 897 } |
| 898 |
1380 void V8TestInterface::derefObject(void* object) | 899 void V8TestInterface::derefObject(void* object) |
1381 { | 900 { |
1382 fromInternalPointer(object)->deref(); | 901 fromInternalPointer(object)->deref(); |
1383 } | 902 } |
1384 | 903 |
1385 template<> | 904 template<> |
1386 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle
<v8::Object> creationContext, v8::Isolate* isolate) | 905 v8::Handle<v8::Value> toV8NoInline(TestInterface* impl, v8::Handle<v8::Object> c
reationContext, v8::Isolate* isolate) |
1387 { | 906 { |
1388 return toV8(impl, creationContext, isolate); | 907 return toV8(impl, creationContext, isolate); |
1389 } | 908 } |
1390 | 909 |
1391 } // namespace WebCore | 910 } // namespace WebCore |
1392 #endif // ENABLE(CONDITION) | 911 #endif // ENABLE(Condition1) || ENABLE(Condition2) |
OLD | NEW |