1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
9 #include "V8TestInterface.h"
11 #include "RuntimeEnabledFeatures.h"
13 #include "V8TestImplementedAs.h"
14 #include "V8TestInterfaceEmpty.h"
15 #include "bindings/tests/idls/TestImplements2.h"
16 #include "bindings/tests/idls/TestImplements3Implementation.h"
17 #include "bindings/tests/idls/TestPartialInterface.h"
18 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h"
19 #include "bindings/v8/ExceptionState.h"
20 #include "bindings/v8/ScriptValue.h"
21 #include "bindings/v8/V8AbstractEventListener.h"
22 #include "bindings/v8/V8DOMConfiguration.h"
23 #include "bindings/v8/V8EventListenerList.h"
24 #include "bindings/v8/V8HiddenValue.h"
25 #include "bindings/v8/V8ObjectConstructor.h"
26 #include "core/dom/ContextFeatures.h"
27 #include "core/dom/Document.h"
28 #include "platform/TraceEvent.h"
29 #include "wtf/GetPtr.h"
30 #include "wtf/RefPtr.h"
34 static void initializeScriptWrappableForInterface(TestInterfaceImplementation* object)
36 if (ScriptWrappable::wrapperCanBeStoredInObject(object))
37 ScriptWrappable::fromObject(object)->setTypeInfo(&V8TestInterface::wrapperTypeInfo);
42 } // namespace WebCore
44 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfaceImplementation* object)
46 WebCore::initializeScriptWrappableForInterface(object);
50 const WrapperTypeInfo V8TestInterface::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterface::domTemplate, V8TestInterface::derefObject, V8TestInterface::toActiveDOMObject, 0, V8TestInterface::visitDOMWrapper, V8TestInterface::installPerContextEnabledMethods, &V8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeObjectPrototype, RefCountedObject };
52 namespace TestInterfaceImplementationV8Internal {
54 template <typename T> void V8_USE(T) { }
56 static void testInterfaceAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
58 v8::Handle<v8::Object> holder = info.Holder();
59 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
60 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl);
63 static void testInterfaceAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
65 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
66 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeGetter(info);
67 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
70 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
72 v8::Handle<v8::Object> holder = info.Holder();
73 ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfaceAttribute", "TestInterface", holder, info.GetIsolate());
74 if (!V8TestInterface::hasInstance(v8Value, info.GetIsolate())) {
75 exceptionState.throwTypeError("The provided value is not of type 'TestInterface'.");
76 exceptionState.throwIfNeeded();
79 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
80 TONATIVE_VOID(TestInterfaceImplementation*, cppValue, V8TestInterface::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
81 impl->setTestInterfaceAttribute(WTF::getPtr(cppValue));
84 static void testInterfaceAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
86 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
87 TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetter(v8Value, info);
88 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
91 static void doubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
93 v8::Handle<v8::Object> holder = info.Holder();
94 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
95 v8SetReturnValue(info, impl->doubleAttribute());
98 static void doubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
101 TestInterfaceImplementationV8Internal::doubleAttributeAttributeGetter(info);
102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
105 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
107 v8::Handle<v8::Object> holder = info.Holder();
108 ExceptionState exceptionState(ExceptionState::SetterContext, "doubleAttribute", "TestInterface", holder, info.GetIsolate());
109 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
110 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue()));
111 if (!std::isfinite(cppValue)) {
112 exceptionState.throwTypeError("The provided double value is non-finite.");
113 exceptionState.throwIfNeeded();
116 impl->setDoubleAttribute(cppValue);
119 static void doubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
121 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
122 TestInterfaceImplementationV8Internal::doubleAttributeAttributeSetter(v8Value, info);
123 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
126 static void floatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
128 v8::Handle<v8::Object> holder = info.Holder();
129 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
130 v8SetReturnValue(info, impl->floatAttribute());
133 static void floatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
135 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
136 TestInterfaceImplementationV8Internal::floatAttributeAttributeGetter(info);
137 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
140 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
142 v8::Handle<v8::Object> holder = info.Holder();
143 ExceptionState exceptionState(ExceptionState::SetterContext, "floatAttribute", "TestInterface", holder, info.GetIsolate());
144 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
145 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue()));
146 if (!std::isfinite(cppValue)) {
147 exceptionState.throwTypeError("The provided float value is non-finite.");
148 exceptionState.throwIfNeeded();
151 impl->setFloatAttribute(cppValue);
154 static void floatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
156 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
157 TestInterfaceImplementationV8Internal::floatAttributeAttributeSetter(v8Value, info);
158 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
161 static void unrestrictedDoubleAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
163 v8::Handle<v8::Object> holder = info.Holder();
164 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
165 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute());
168 static void unrestrictedDoubleAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
170 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
171 TestInterfaceImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetter(info);
172 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
175 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
177 v8::Handle<v8::Object> holder = info.Holder();
178 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
179 TONATIVE_VOID(double, cppValue, static_cast<double>(v8Value->NumberValue()));
180 impl->setUnrestrictedDoubleAttribute(cppValue);
183 static void unrestrictedDoubleAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
185 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
186 TestInterfaceImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetter(v8Value, info);
187 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
190 static void unrestrictedFloatAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
192 v8::Handle<v8::Object> holder = info.Holder();
193 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
194 v8SetReturnValue(info, impl->unrestrictedFloatAttribute());
197 static void unrestrictedFloatAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
199 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
200 TestInterfaceImplementationV8Internal::unrestrictedFloatAttributeAttributeGetter(info);
201 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
204 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
206 v8::Handle<v8::Object> holder = info.Holder();
207 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
208 TONATIVE_VOID(float, cppValue, static_cast<float>(v8Value->NumberValue()));
209 impl->setUnrestrictedFloatAttribute(cppValue);
212 static void unrestrictedFloatAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
214 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
215 TestInterfaceImplementationV8Internal::unrestrictedFloatAttributeAttributeSetter(v8Value, info);
216 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
219 static void staticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
221 v8SetReturnValueString(info, TestInterfaceImplementation::staticStringAttribute(), info.GetIsolate());
224 static void staticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
226 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
227 TestInterfaceImplementationV8Internal::staticStringAttributeAttributeGetter(info);
228 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
231 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
233 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
234 TestInterfaceImplementation::setStaticStringAttribute(cppValue);
237 static void staticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
239 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
240 TestInterfaceImplementationV8Internal::staticStringAttributeAttributeSetter(v8Value, info);
241 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
244 static void implementsStaticReadOnlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
246 v8SetReturnValueInt(info, TestInterfaceImplementation::implementsStaticReadOnlyLongAttribute());
249 static void implementsStaticReadOnlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
251 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
252 TestInterfaceImplementationV8Internal::implementsStaticReadOnlyLongAttributeAttributeGetter(info);
253 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
256 static void implementsStaticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
258 v8SetReturnValueString(info, TestInterfaceImplementation::implementsStaticStringAttribute(), info.GetIsolate());
261 static void implementsStaticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
263 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
264 TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeGetter(info);
265 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
268 static void implementsStaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
270 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
271 TestInterfaceImplementation::setImplementsStaticStringAttribute(cppValue);
274 static void implementsStaticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
276 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
277 TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeSetter(v8Value, info);
278 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
281 static void implementsReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
283 v8::Handle<v8::Object> holder = info.Holder();
284 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
285 v8SetReturnValueString(info, impl->implementsReadonlyStringAttribute(), info.GetIsolate());
288 static void implementsReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
290 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
291 TestInterfaceImplementationV8Internal::implementsReadonlyStringAttributeAttributeGetter(info);
292 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
295 static void implementsStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
297 v8::Handle<v8::Object> holder = info.Holder();
298 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
299 v8SetReturnValueString(info, impl->implementsStringAttribute(), info.GetIsolate());
302 static void implementsStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
304 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
305 TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeGetter(info);
306 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
309 static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
311 v8::Handle<v8::Object> holder = info.Holder();
312 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
313 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
314 impl->setImplementsStringAttribute(cppValue);
317 static void implementsStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
319 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
320 TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeSetter(v8Value, info);
321 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
324 static void implementsNodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
326 v8::Handle<v8::Object> holder = info.Holder();
327 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
328 v8SetReturnValueFast(info, WTF::getPtr(impl->implementsNodeAttribute()), impl);
331 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
333 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
334 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeGetter(info);
335 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
338 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
340 v8::Handle<v8::Object> holder = info.Holder();
341 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNodeAttribute", "TestInterface", holder, info.GetIsolate());
342 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) {
343 exceptionState.throwTypeError("The provided value is not of type 'Node'.");
344 exceptionState.throwIfNeeded();
347 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
348 TONATIVE_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
349 impl->setImplementsNodeAttribute(WTF::getPtr(cppValue));
352 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
354 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
355 TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSetter(v8Value, info);
356 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
359 static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
361 v8::Handle<v8::Object> holder = info.Holder();
362 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
363 EventListener* v8Value = impl->implementsEventHandlerAttribute();
364 v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
367 static void implementsEventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
369 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
370 TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttributeGetter(info);
371 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
374 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
376 v8::Handle<v8::Object> holder = info.Holder();
377 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
378 moveEventListenerToNewWrapper(holder, impl->implementsEventHandlerAttribute(), v8Value, V8TestInterface::eventListenerCacheIndex, info.GetIsolate());
379 impl->setImplementsEventHandlerAttribute(V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
382 static void implementsEventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
384 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
385 TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttributeSetter(v8Value, info);
386 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
389 static void implementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
391 v8::Handle<v8::Object> holder = info.Holder();
392 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
393 v8SetReturnValueFast(info, WTF::getPtr(impl->implementsRuntimeEnabledNodeAttribute()), impl);
396 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
398 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
399 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGetter(info);
400 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
403 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
405 v8::Handle<v8::Object> holder = info.Holder();
406 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRuntimeEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate());
407 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) {
408 exceptionState.throwTypeError("The provided value is not of type 'Node'.");
409 exceptionState.throwIfNeeded();
412 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
413 TONATIVE_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
414 impl->setImplementsRuntimeEnabledNodeAttribute(WTF::getPtr(cppValue));
417 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
419 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
420 TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSetter(v8Value, info);
421 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
424 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
426 v8::Handle<v8::Object> holder = info.Holder();
427 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
428 v8SetReturnValueFast(info, WTF::getPtr(impl->implementsPerContextEnabledNodeAttribute()), impl);
431 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
433 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
434 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeGetter(info);
435 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
438 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
440 v8::Handle<v8::Object> holder = info.Holder();
441 ExceptionState exceptionState(ExceptionState::SetterContext, "implementsPerContextEnabledNodeAttribute", "TestInterface", holder, info.GetIsolate());
442 if (!V8Node::hasInstance(v8Value, info.GetIsolate())) {
443 exceptionState.throwTypeError("The provided value is not of type 'Node'.");
444 exceptionState.throwIfNeeded();
447 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
448 TONATIVE_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
449 impl->setImplementsPerContextEnabledNodeAttribute(WTF::getPtr(cppValue));
452 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
454 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
455 TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeSetter(v8Value, info);
456 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
459 static void implements2StaticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
461 v8SetReturnValueString(info, TestImplements2::implements2StaticStringAttribute(), info.GetIsolate());
464 static void implements2StaticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
466 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
467 TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeGetter(info);
468 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
471 static void implements2StaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
473 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
474 TestImplements2::setImplements2StaticStringAttribute(cppValue);
477 static void implements2StaticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
479 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
480 TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeSetter(v8Value, info);
481 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
484 static void implements2StringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
486 v8::Handle<v8::Object> holder = info.Holder();
487 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
489 v8SetReturnValueString(info, TestImplements2::implements2StringAttribute(*impl), info.GetIsolate());
492 static void implements2StringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
494 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
495 TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeGetter(info);
496 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
499 static void implements2StringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
501 v8::Handle<v8::Object> holder = info.Holder();
502 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
504 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
505 TestImplements2::setImplements2StringAttribute(*impl, cppValue);
508 static void implements2StringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
510 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
511 TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeSetter(v8Value, info);
512 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
515 static void implements3StringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
517 v8::Handle<v8::Object> holder = info.Holder();
518 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
520 v8SetReturnValueString(info, TestImplements3Implementation::implements3StringAttribute(*impl), info.GetIsolate());
523 static void implements3StringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
525 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
526 TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeGetter(info);
527 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
530 static void implements3StringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
532 v8::Handle<v8::Object> holder = info.Holder();
533 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
535 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
536 TestImplements3Implementation::setImplements3StringAttribute(*impl, cppValue);
539 static void implements3StringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
541 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
542 TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeSetter(v8Value, info);
543 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
546 static void implements3StaticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
548 v8SetReturnValueString(info, TestImplements3Implementation::implements3StaticStringAttribute(), info.GetIsolate());
551 static void implements3StaticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
553 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
554 TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttributeGetter(info);
555 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
558 static void implements3StaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
560 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
561 TestImplements3Implementation::setImplements3StaticStringAttribute(cppValue);
564 static void implements3StaticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
566 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
567 TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttributeSetter(v8Value, info);
568 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
571 #if ENABLE(PARTIAL_CONDITION)
572 static void partialLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
574 v8::Handle<v8::Object> holder = info.Holder();
575 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
577 v8SetReturnValueInt(info, TestPartialInterface::partialLongAttribute(*impl));
579 #endif // ENABLE(PARTIAL_CONDITION)
581 #if ENABLE(PARTIAL_CONDITION)
582 static void partialLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
584 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
585 TestInterfaceImplementationV8Internal::partialLongAttributeAttributeGetter(info);
586 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
588 #endif // ENABLE(PARTIAL_CONDITION)
590 #if ENABLE(PARTIAL_CONDITION)
591 static void partialLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
593 v8::Handle<v8::Object> holder = info.Holder();
594 ExceptionState exceptionState(ExceptionState::SetterContext, "partialLongAttribute", "TestInterface", holder, info.GetIsolate());
595 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
597 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
598 TestPartialInterface::setPartialLongAttribute(*impl, cppValue);
600 #endif // ENABLE(PARTIAL_CONDITION)
602 #if ENABLE(PARTIAL_CONDITION)
603 static void partialLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
605 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
606 TestInterfaceImplementationV8Internal::partialLongAttributeAttributeSetter(v8Value, info);
607 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
609 #endif // ENABLE(PARTIAL_CONDITION)
611 #if ENABLE(PARTIAL_CONDITION)
612 static void partialStaticLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
614 v8SetReturnValueInt(info, TestPartialInterface::partialStaticLongAttribute());
616 #endif // ENABLE(PARTIAL_CONDITION)
618 #if ENABLE(PARTIAL_CONDITION)
619 static void partialStaticLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
621 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
622 TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeGetter(info);
623 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
625 #endif // ENABLE(PARTIAL_CONDITION)
627 #if ENABLE(PARTIAL_CONDITION)
628 static void partialStaticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
630 ExceptionState exceptionState(ExceptionState::SetterContext, "partialStaticLongAttribute", "TestInterface", holder, info.GetIsolate());
631 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
632 TestPartialInterface::setPartialStaticLongAttribute(cppValue);
634 #endif // ENABLE(PARTIAL_CONDITION)
636 #if ENABLE(PARTIAL_CONDITION)
637 static void partialStaticLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
639 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
640 TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeSetter(v8Value, info);
641 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
643 #endif // ENABLE(PARTIAL_CONDITION)
645 #if ENABLE(PARTIAL_CONDITION)
646 static void partialCallWithExecutionContextLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
648 v8::Handle<v8::Object> holder = info.Holder();
649 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
651 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
652 v8SetReturnValueInt(info, TestPartialInterface::partialCallWithExecutionContextLongAttribute(scriptContext, *impl));
654 #endif // ENABLE(PARTIAL_CONDITION)
656 #if ENABLE(PARTIAL_CONDITION)
657 static void partialCallWithExecutionContextLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
659 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
660 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeGetter(info);
661 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
663 #endif // ENABLE(PARTIAL_CONDITION)
665 #if ENABLE(PARTIAL_CONDITION)
666 static void partialCallWithExecutionContextLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
668 v8::Handle<v8::Object> holder = info.Holder();
669 ExceptionState exceptionState(ExceptionState::SetterContext, "partialCallWithExecutionContextLongAttribute", "TestInterface", holder, info.GetIsolate());
670 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
672 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
673 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
674 TestPartialInterface::setPartialCallWithExecutionContextLongAttribute(scriptContext, *impl, cppValue);
676 #endif // ENABLE(PARTIAL_CONDITION)
678 #if ENABLE(PARTIAL_CONDITION)
679 static void partialCallWithExecutionContextLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
681 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
682 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeSetter(v8Value, info);
683 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
685 #endif // ENABLE(PARTIAL_CONDITION)
687 #if ENABLE(PARTIAL_CONDITION)
688 static void partialPartialEnumTypeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
690 v8::Handle<v8::Object> holder = info.Holder();
691 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
693 v8SetReturnValueString(info, TestPartialInterface::partialPartialEnumTypeAttribute(*impl), info.GetIsolate());
695 #endif // ENABLE(PARTIAL_CONDITION)
697 #if ENABLE(PARTIAL_CONDITION)
698 static void partialPartialEnumTypeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
700 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
701 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttributeGetter(info);
702 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
704 #endif // ENABLE(PARTIAL_CONDITION)
706 #if ENABLE(PARTIAL_CONDITION)
707 static void partialPartialEnumTypeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
709 v8::Handle<v8::Object> holder = info.Holder();
710 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
712 TOSTRING_VOID(V8StringResource<>, cppValue, v8Value);
713 String string = cppValue;
714 if (!(string == "foo" || string == "bar"))
716 TestPartialInterface::setPartialPartialEnumTypeAttribute(*impl, cppValue);
718 #endif // ENABLE(PARTIAL_CONDITION)
720 #if ENABLE(PARTIAL_CONDITION)
721 static void partialPartialEnumTypeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
723 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
724 TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttributeSetter(v8Value, info);
725 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
727 #endif // ENABLE(PARTIAL_CONDITION)
729 static void partial2LongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
731 v8::Handle<v8::Object> holder = info.Holder();
732 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
734 v8SetReturnValueInt(info, TestPartialInterfaceImplementation::partial2LongAttribute(*impl));
737 static void partial2LongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
739 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
740 TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeGetter(info);
741 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
744 static void partial2LongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
746 v8::Handle<v8::Object> holder = info.Holder();
747 ExceptionState exceptionState(ExceptionState::SetterContext, "partial2LongAttribute", "TestInterface", holder, info.GetIsolate());
748 TestInterfaceImplementation* impl = V8TestInterface::toNative(holder);
750 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
751 TestPartialInterfaceImplementation::setPartial2LongAttribute(*impl, cppValue);
754 static void partial2LongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
756 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
757 TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeSetter(v8Value, info);
758 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
761 static void partial2StaticLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
763 v8SetReturnValueInt(info, TestPartialInterfaceImplementation::partial2StaticLongAttribute());
766 static void partial2StaticLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
768 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
769 TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeGetter(info);
770 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
773 static void partial2StaticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
775 ExceptionState exceptionState(ExceptionState::SetterContext, "partial2StaticLongAttribute", "TestInterface", holder, info.GetIsolate());
776 TONATIVE_VOID_EXCEPTIONSTATE(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
777 TestPartialInterfaceImplementation::setPartial2StaticLongAttribute(cppValue);
780 static void partial2StaticLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
782 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
783 TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeSetter(v8Value, info);
784 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
787 static void TestInterfaceImplementationConstructorGetter(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
789 v8::Handle<v8::Value> data = info.Data();
790 ASSERT(data->IsExternal());
791 V8PerContextData* perContextData = V8PerContextData::from(info.Holder()->CreationContext());
794 v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
797 static void TestInterfaceImplementationReplaceableAttributeSetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
799 if (info.This()->IsObject())
800 v8::Handle<v8::Object>::Cast(info.This())->ForceSet(name, v8Value);
803 static void TestInterfaceImplementationReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
805 TestInterfaceImplementationV8Internal::TestInterfaceImplementationReplaceableAttributeSetter(name, v8Value, info);
808 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
810 if (UNLIKELY(info.Length() < 1)) {
811 throwArityTypeErrorForMethod("voidMethodTestInterfaceEmptyArg", "TestInterface", 1, info.Length(), info.GetIsolate());
814 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
815 if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) {
816 throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate());
819 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
820 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
823 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
825 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
826 TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(info);
827 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
830 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
832 if (UNLIKELY(info.Length() < 2)) {
833 throwArityTypeErrorForMethod("voidMethodDoubleArgFloatArg", "TestInterface", 2, info.Length(), info.GetIsolate());
836 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
837 TONATIVE_VOID(double, doubleArg, static_cast<double>(info[0]->NumberValue()));
838 if (!std::isfinite(doubleArg)) {
839 throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFloatArg", "TestInterface", "double parameter 1 is non-finite."), info.GetIsolate());
842 TONATIVE_VOID(float, floatArg, static_cast<float>(info[1]->NumberValue()));
843 if (!std::isfinite(floatArg)) {
844 throwTypeError(ExceptionMessages::failedToExecute("voidMethodDoubleArgFloatArg", "TestInterface", "float parameter 2 is non-finite."), info.GetIsolate());
847 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg);
850 static void voidMethodDoubleArgFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
852 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
853 TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info);
854 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
857 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
859 if (UNLIKELY(info.Length() < 2)) {
860 throwArityTypeErrorForMethod("voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", "TestInterface", 2, info.Length(), info.GetIsolate());
863 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
864 TONATIVE_VOID(double, unrestrictedDoubleArg, static_cast<double>(info[0]->NumberValue()));
865 TONATIVE_VOID(float, unrestrictedFloatArg, static_cast<float>(info[1]->NumberValue()));
866 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleArg, unrestrictedFloatArg);
869 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
871 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
872 TestInterfaceImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(info);
873 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
876 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
878 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
882 static void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
884 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
885 TestInterfaceImplementationV8Internal::voidMethodMethod(info);
886 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
889 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
891 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
895 static void voidMethodMethodCallbackForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
897 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
898 TestInterfaceImplementationV8Internal::voidMethodMethodForMainWorld(info);
899 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
902 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
904 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
905 impl->implementsVoidMethod();
908 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
910 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
911 TestInterfaceImplementationV8Internal::implementsVoidMethodMethod(info);
912 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
915 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
917 ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsComplexMethod", "TestInterface", info.Holder(), info.GetIsolate());
918 if (UNLIKELY(info.Length() < 2)) {
919 throwArityTypeError(exceptionState, 2, info.Length());
922 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
923 TOSTRING_VOID(V8StringResource<>, strArg, info[0]);
924 if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], info.GetIsolate())) {
925 exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
926 exceptionState.throwIfNeeded();
929 TONATIVE_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
930 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
931 RefPtr<TestInterfaceEmpty> result = impl->implementsComplexMethod(scriptContext, strArg, testInterfaceEmptyArg, exceptionState);
932 if (exceptionState.throwIfNeeded())
934 v8SetReturnValue(info, result.release());
937 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
939 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
940 TestInterfaceImplementationV8Internal::implementsComplexMethodMethod(info);
941 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
944 static void implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
946 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
947 V8TestInterface::implementsCustomVoidMethodMethodCustom(info);
948 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
951 static void implementsStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
953 TestInterfaceImplementation::implementsStaticVoidMethod();
956 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
958 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
959 TestInterfaceImplementationV8Internal::implementsStaticVoidMethodMethod(info);
960 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
963 static void implements2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
965 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
967 TestImplements2::implements2VoidMethod(*impl);
970 static void implements2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
972 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
973 TestInterfaceImplementationV8Internal::implements2VoidMethodMethod(info);
974 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
977 static void implements3VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
979 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
981 TestImplements3Implementation::implements3VoidMethod(*impl);
984 static void implements3VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
986 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
987 TestInterfaceImplementationV8Internal::implements3VoidMethodMethod(info);
988 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
991 static void implements3StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
993 TestImplements3Implementation::implements3StaticVoidMethod();
996 static void implements3StaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
998 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
999 TestInterfaceImplementationV8Internal::implements3StaticVoidMethodMethod(info);
1000 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1003 #if ENABLE(PARTIAL_CONDITION)
1004 static void partialVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1006 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1008 TestPartialInterface::partialVoidMethod(*impl);
1010 #endif // ENABLE(PARTIAL_CONDITION)
1012 #if ENABLE(PARTIAL_CONDITION)
1013 static void partialVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1015 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1016 TestInterfaceImplementationV8Internal::partialVoidMethodMethod(info);
1017 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1019 #endif // ENABLE(PARTIAL_CONDITION)
1021 #if ENABLE(PARTIAL_CONDITION)
1022 static void partialStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1024 TestPartialInterface::partialStaticVoidMethod();
1026 #endif // ENABLE(PARTIAL_CONDITION)
1028 #if ENABLE(PARTIAL_CONDITION)
1029 static void partialStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1031 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1032 TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethod(info);
1033 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1035 #endif // ENABLE(PARTIAL_CONDITION)
1037 #if ENABLE(PARTIAL_CONDITION)
1038 static void partialVoidMethodLongArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1040 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoidMethodLongArg", "TestInterface", info.Holder(), info.GetIsolate());
1041 if (UNLIKELY(info.Length() < 1)) {
1042 throwArityTypeError(exceptionState, 1, info.Length());
1045 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1046 TONATIVE_VOID_EXCEPTIONSTATE(int, longArg, toInt32(info[0], exceptionState), exceptionState);
1048 TestPartialInterface::partialVoidMethodLongArg(*impl, longArg);
1050 #endif // ENABLE(PARTIAL_CONDITION)
1052 #if ENABLE(PARTIAL_CONDITION)
1053 static void partialVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1055 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1056 TestInterfaceImplementationV8Internal::partialVoidMethodLongArgMethod(info);
1057 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1059 #endif // ENABLE(PARTIAL_CONDITION)
1061 #if ENABLE(PARTIAL_CONDITION)
1062 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1064 ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialCallWithExecutionContextRaisesExceptionVoidMethod", "TestInterface", info.Holder(), info.GetIsolate());
1065 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1067 ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
1068 TestPartialInterface::partialCallWithExecutionContextRaisesExceptionVoidMethod(scriptContext, *impl, exceptionState);
1069 if (exceptionState.throwIfNeeded())
1072 #endif // ENABLE(PARTIAL_CONDITION)
1074 #if ENABLE(PARTIAL_CONDITION)
1075 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1077 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1078 TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(info);
1079 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1081 #endif // ENABLE(PARTIAL_CONDITION)
1083 #if ENABLE(PARTIAL_CONDITION)
1084 static void partialVoidMethodPartialCallbackTypeArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1086 if (UNLIKELY(info.Length() < 1)) {
1087 throwArityTypeErrorForMethod("partialVoidMethodPartialCallbackTypeArg", "TestInterface", 1, info.Length(), info.GetIsolate());
1090 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1091 TONATIVE_VOID(ScriptValue, partialCallbackTypeArg, ScriptValue(ScriptState::current(info.GetIsolate()), info[0]));
1093 TestPartialInterface::partialVoidMethodPartialCallbackTypeArg(*impl, partialCallbackTypeArg);
1095 #endif // ENABLE(PARTIAL_CONDITION)
1097 #if ENABLE(PARTIAL_CONDITION)
1098 static void partialVoidMethodPartialCallbackTypeArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1100 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1101 TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeArgMethod(info);
1102 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1104 #endif // ENABLE(PARTIAL_CONDITION)
1106 static void partial2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1108 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1110 TestPartialInterfaceImplementation::partial2VoidMethod(*impl);
1113 static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1115 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1116 TestInterfaceImplementationV8Internal::partial2VoidMethodMethod(info);
1117 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1120 static void partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1122 TestPartialInterfaceImplementation::partial2StaticVoidMethod();
1125 static void partial2StaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1127 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1128 TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethod(info);
1129 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1132 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
1134 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1135 String result = impl->anonymousIndexedGetter(index);
1136 if (result.isNull())
1138 v8SetReturnValueString(info, result, info.GetIsolate());
1141 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Value>& info)
1143 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
1144 TestInterfaceImplementationV8Internal::indexedPropertyGetter(index, info);
1145 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1148 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
1150 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1151 TOSTRING_VOID(V8StringResource<>, propertyValue, v8Value);
1152 bool result = impl->anonymousIndexedSetter(index, propertyValue);
1155 v8SetReturnValue(info, v8Value);
1158 static void indexedPropertySetterCallback(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
1160 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
1161 TestInterfaceImplementationV8Internal::indexedPropertySetter(index, v8Value, info);
1162 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1165 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
1167 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1168 DeleteResult result = impl->anonymousIndexedDeleter(index);
1169 if (result != DeleteUnknownProperty)
1170 return v8SetReturnValueBool(info, result == DeleteSuccess);
1173 static void indexedPropertyDeleterCallback(uint32_t index, const v8::PropertyCallbackInfo<v8::Boolean>& info)
1175 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMIndexedProperty");
1176 TestInterfaceImplementationV8Internal::indexedPropertyDeleter(index, info);
1177 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1180 static void namedPropertyGetter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1182 if (info.Holder()->HasRealNamedProperty(name))
1184 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
1187 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1188 AtomicString propertyName = toCoreAtomicString(name);
1189 String result = impl->anonymousNamedGetter(propertyName);
1190 if (result.isNull())
1192 v8SetReturnValueString(info, result, info.GetIsolate());
1195 static void namedPropertyGetterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Value>& info)
1197 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
1198 TestInterfaceImplementationV8Internal::namedPropertyGetter(name, info);
1199 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1202 static void namedPropertySetter(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
1204 if (info.Holder()->HasRealNamedProperty(name))
1206 if (!info.Holder()->GetRealNamedPropertyInPrototypeChain(name).IsEmpty())
1209 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1210 TOSTRING_VOID(V8StringResource<>, propertyName, name);
1211 TOSTRING_VOID(V8StringResource<>, propertyValue, v8Value);
1212 bool result = impl->anonymousNamedSetter(propertyName, propertyValue);
1215 v8SetReturnValue(info, v8Value);
1218 static void namedPropertySetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info)
1220 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
1221 TestInterfaceImplementationV8Internal::namedPropertySetter(name, v8Value, info);
1222 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1225 static void namedPropertyQuery(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
1227 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1228 AtomicString propertyName = toCoreAtomicString(name);
1229 v8::String::Utf8Value namedProperty(name);
1230 ExceptionState exceptionState(ExceptionState::GetterContext, *namedProperty, "TestInterface", info.Holder(), info.GetIsolate());
1231 bool result = impl->namedPropertyQuery(propertyName, exceptionState);
1232 if (exceptionState.throwIfNeeded())
1236 v8SetReturnValueInt(info, v8::None);
1239 static void namedPropertyQueryCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Integer>& info)
1241 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
1242 TestInterfaceImplementationV8Internal::namedPropertyQuery(name, info);
1243 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1246 static void namedPropertyDeleter(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
1248 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1249 AtomicString propertyName = toCoreAtomicString(name);
1250 DeleteResult result = impl->anonymousNamedDeleter(propertyName);
1251 if (result != DeleteUnknownProperty)
1252 return v8SetReturnValueBool(info, result == DeleteSuccess);
1255 static void namedPropertyDeleterCallback(v8::Local<v8::String> name, const v8::PropertyCallbackInfo<v8::Boolean>& info)
1257 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
1258 TestInterfaceImplementationV8Internal::namedPropertyDeleter(name, info);
1259 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1262 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& info)
1264 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder());
1265 v8::Isolate* isolate = info.GetIsolate();
1266 Vector<String> names;
1267 ExceptionState exceptionState(ExceptionState::EnumerationContext, "TestInterface", info.Holder(), isolate);
1268 impl->namedPropertyEnumerator(names, exceptionState);
1269 if (exceptionState.throwIfNeeded())
1271 v8::Handle<v8::Array> v8names = v8::Array::New(isolate, names.size());
1272 for (size_t i = 0; i < names.size(); ++i)
1273 v8names->Set(v8::Integer::New(isolate, i), v8String(isolate, names[i]));
1274 v8SetReturnValue(info, v8names);
1277 static void namedPropertyEnumeratorCallback(const v8::PropertyCallbackInfo<v8::Array>& info)
1279 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMNamedProperty");
1280 TestInterfaceImplementationV8Internal::namedPropertyEnumerator(info);
1281 TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1284 } // namespace TestInterfaceImplementationV8Internal
1286 void V8TestInterface::visitDOMWrapper(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
1288 TestInterfaceImplementation* impl = fromInternalPointer(object);
1289 v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper);
1290 V8WrapperInstantiationScope scope(creationContext, isolate);
1291 TestInterfaceImplementation* referencedName = impl->referencedName();
1292 if (referencedName) {
1293 if (!DOMDataStore::containsWrapper<V8TestInterface>(referencedName, isolate))
1294 wrap(referencedName, creationContext, isolate);
1295 DOMDataStore::setWrapperReference<V8TestInterface>(wrapper, referencedName, isolate);
1297 setObjectGroup(object, wrapper, isolate);
1300 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfaceAttributes[] = {
1301 {"testInterfaceAttribute", TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::testInterfaceAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1302 {"testImplementedAsConstructorAttribute", TestInterfaceImplementationV8Internal::TestInterfaceImplementationConstructorGetter, TestInterfaceImplementationV8Internal::TestInterfaceImplementationReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestImplementedAs::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
1303 {"doubleAttribute", TestInterfaceImplementationV8Internal::doubleAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::doubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1304 {"floatAttribute", TestInterfaceImplementationV8Internal::floatAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::floatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1305 {"unrestrictedDoubleAttribute", TestInterfaceImplementationV8Internal::unrestrictedDoubleAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1306 {"unrestrictedFloatAttribute", TestInterfaceImplementationV8Internal::unrestrictedFloatAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1307 {"implementsReadonlyStringAttribute", TestInterfaceImplementationV8Internal::implementsReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1308 {"implementsStringAttribute", TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implementsStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1309 {"implementsNodeAttribute", TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implementsNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1310 {"implementsEventHandlerAttribute", TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implementsEventHandlerAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1311 {"implements3StringAttribute", TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implements3StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1314 static const V8DOMConfiguration::MethodConfiguration V8TestInterfaceMethods[] = {
1315 {"voidMethodTestInterfaceEmptyArg", TestInterfaceImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1},
1316 {"voidMethodDoubleArgFloatArg", TestInterfaceImplementationV8Internal::voidMethodDoubleArgFloatArgMethodCallback, 0, 2},
1317 {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", TestInterfaceImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback, 0, 2},
1318 {"voidMethod", TestInterfaceImplementationV8Internal::voidMethodMethodCallback, TestInterfaceImplementationV8Internal::voidMethodMethodCallbackForMainWorld, 0},
1319 {"implementsVoidMethod", TestInterfaceImplementationV8Internal::implementsVoidMethodMethodCallback, 0, 0},
1320 {"implementsComplexMethod", TestInterfaceImplementationV8Internal::implementsComplexMethodMethodCallback, 0, 2},
1321 {"implementsCustomVoidMethod", TestInterfaceImplementationV8Internal::implementsCustomVoidMethodMethodCallback, 0, 0},
1322 {"implements3VoidMethod", TestInterfaceImplementationV8Internal::implements3VoidMethodMethodCallback, 0, 0},
1325 static void configureV8TestInterfaceTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
1327 functionTemplate->ReadOnlyPrototype();
1329 v8::Local<v8::Signature> defaultSignature;
1330 if (!RuntimeEnabledFeatures::featureNameEnabled())
1331 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterface::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate);
1333 defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterface", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterface::internalFieldCount,
1334 V8TestInterfaceAttributes, WTF_ARRAY_LENGTH(V8TestInterfaceAttributes),
1336 V8TestInterfaceMethods, WTF_ARRAY_LENGTH(V8TestInterfaceMethods),
1338 v8::Local<v8::ObjectTemplate> instanceTemplate ALLOW_UNUSED = functionTemplate->InstanceTemplate();
1339 v8::Local<v8::ObjectTemplate> prototypeTemplate ALLOW_UNUSED = functionTemplate->PrototypeTemplate();
1340 if (RuntimeEnabledFeatures::implementsFeatureNameEnabled()) {
1341 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1342 {"implementsRuntimeEnabledNodeAttribute", TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1343 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1345 if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) {
1346 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1347 {"implements2StringAttribute", TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implements2StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1348 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1350 #if ENABLE(PARTIAL_CONDITION)
1351 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1352 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1353 {"partialLongAttribute", TestInterfaceImplementationV8Internal::partialLongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partialLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1354 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1356 #endif // ENABLE(PARTIAL_CONDITION)
1357 #if ENABLE(PARTIAL_CONDITION)
1358 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1359 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1360 {"partialCallWithExecutionContextLongAttribute", TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1361 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1363 #endif // ENABLE(PARTIAL_CONDITION)
1364 #if ENABLE(PARTIAL_CONDITION)
1365 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1366 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1367 {"partialPartialEnumTypeAttribute", TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partialPartialEnumTypeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1368 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1370 #endif // ENABLE(PARTIAL_CONDITION)
1371 static const V8DOMConfiguration::ConstantConfiguration V8TestInterfaceConstants[] = {
1372 {"UNSIGNED_LONG", 0},
1373 {"CONST_JAVASCRIPT", 1},
1374 {"IMPLEMENTS_CONSTANT_1", 1},
1375 {"IMPLEMENTS_CONSTANT_2", 2},
1376 {"PARTIAL2_UNSIGNED_SHORT", 0},
1378 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate);
1379 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1380 static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"PARTIAL_UNSIGNED_SHORT", static_cast<signed int>(0)};
1381 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, &constantConfiguration, 1, isolate);
1383 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterfaceImplementationV8Internal::indexedPropertyGetterCallback, TestInterfaceImplementationV8Internal::indexedPropertySetterCallback, 0, TestInterfaceImplementationV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterfaceImplementation>);
1384 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceImplementationV8Internal::namedPropertyGetterCallback, TestInterfaceImplementationV8Internal::namedPropertySetterCallback, TestInterfaceImplementationV8Internal::namedPropertyQueryCallback, TestInterfaceImplementationV8Internal::namedPropertyDeleterCallback, TestInterfaceImplementationV8Internal::namedPropertyEnumeratorCallback);
1385 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterface::legacyCallCustom);
1386 functionTemplate->Set(v8AtomicString(isolate, "implementsStaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::implementsStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1387 if (RuntimeEnabledFeatures::implements2FeatureNameEnabled())
1388 prototypeTemplate->Set(v8AtomicString(isolate, "implements2VoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::implements2VoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
1389 functionTemplate->Set(v8AtomicString(isolate, "implements3StaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::implements3StaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1390 #if ENABLE(PARTIAL_CONDITION)
1391 if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1392 prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partialVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
1393 #endif // ENABLE(PARTIAL_CONDITION)
1394 #if ENABLE(PARTIAL_CONDITION)
1395 if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1396 functionTemplate->Set(v8AtomicString(isolate, "partialStaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partialStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1397 #endif // ENABLE(PARTIAL_CONDITION)
1398 #if ENABLE(PARTIAL_CONDITION)
1399 if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1400 prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethodLongArg"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partialVoidMethodLongArgMethodCallback, v8Undefined(), defaultSignature, 1));
1401 #endif // ENABLE(PARTIAL_CONDITION)
1402 #if ENABLE(PARTIAL_CONDITION)
1403 if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1404 prototypeTemplate->Set(v8AtomicString(isolate, "partialCallWithExecutionContextRaisesExceptionVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
1405 #endif // ENABLE(PARTIAL_CONDITION)
1406 #if ENABLE(PARTIAL_CONDITION)
1407 if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1408 prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethodPartialCallbackTypeArg"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partialVoidMethodPartialCallbackTypeArgMethodCallback, v8Undefined(), defaultSignature, 1));
1409 #endif // ENABLE(PARTIAL_CONDITION)
1410 functionTemplate->Set(v8AtomicString(isolate, "partial2StaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1411 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttribute"), TestInterfaceImplementationV8Internal::staticStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1412 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsStaticReadOnlyLongAttribute"), TestInterfaceImplementationV8Internal::implementsStaticReadOnlyLongAttributeAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1413 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsStaticStringAttribute"), TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implementsStaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1414 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements2StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implements2StaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1415 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements3StaticStringAttribute"), TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implements3StaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1416 #if ENABLE(PARTIAL_CONDITION)
1417 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "partialStaticLongAttribute"), TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partialStaticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1418 #endif // ENABLE(PARTIAL_CONDITION)
1419 functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "partial2StaticLongAttribute"), TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1421 // Custom toString template
1422 functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::from(isolate)->toStringTemplate());
1425 v8::Handle<v8::FunctionTemplate> V8TestInterface::domTemplate(v8::Isolate* isolate)
1427 V8PerIsolateData* data = V8PerIsolateData::from(isolate);
1428 v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo));
1429 if (!result.IsEmpty())
1432 TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
1433 result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
1434 configureV8TestInterfaceTemplate(result, isolate);
1435 data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result);
1439 bool V8TestInterface::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
1441 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
1444 v8::Handle<v8::Object> V8TestInterface::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
1446 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
1449 TestInterfaceImplementation* V8TestInterface::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
1451 return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
1454 void V8TestInterface::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestInterfaceImplementation* impl, v8::Isolate* isolate)
1456 v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instanceTemplate->GetPrototype());
1457 if (ContextFeatures::implementsContextNameEnabled(impl->document())) {
1458 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1459 {"implementsPerContextEnabledNodeAttribute", TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1460 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1462 if (ContextFeatures::partialContextNameEnabled(impl->document())) {
1463 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1464 {"partial2LongAttribute", TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partial2LongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1465 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1467 if (ContextFeatures::partialContextNameEnabled(impl->document())) {
1468 static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1469 {"partial2StaticLongAttribute", TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeGetterCallback, TestInterfaceImplementationV8Internal::partial2StaticLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1470 V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1474 void V8TestInterface::installPerContextEnabledMethods(v8::Handle<v8::Object> prototypeTemplate, v8::Isolate* isolate)
1476 v8::Local<v8::Signature> defaultSignature = v8::Signature::New(isolate, domTemplate(isolate));
1478 ExecutionContext* context = toExecutionContext(prototypeTemplate->CreationContext());
1479 if (context && context->isDocument() && ContextFeatures::partialContextNameEnabled(toDocument(context)))
1480 prototypeTemplate->Set(v8AtomicString(isolate, "partial2VoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partial2VoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
1481 if (context && context->isDocument() && ContextFeatures::partialContextNameEnabled(toDocument(context)))
1482 prototypeTemplate->Set(v8AtomicString(isolate, "partial2StaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfaceImplementationV8Internal::partial2StaticVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0)->GetFunction());
1485 ActiveDOMObject* V8TestInterface::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
1487 return toNative(wrapper);
1490 void V8TestInterface::derefObject(void* object)
1492 fromInternalPointer(object)->deref();
1496 v8::Handle<v8::Value> toV8NoInline(TestInterfaceImplementation* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
1498 return toV8(impl, creationContext, isolate);
1501 } // namespace WebCore
1502 #endif // ENABLE(CONDITION)