Upstream version 7.35.144.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / bindings / tests / results / V8TestInterfacePython.cpp
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6
7 #include "config.h"
8 #if ENABLE(CONDITION)
9 #include "V8TestInterfacePython.h"
10
11 #include "RuntimeEnabledFeatures.h"
12 #include "V8Node.h"
13 #include "V8TestImplementedAs.h"
14 #include "V8TestInterfaceEmpty.h"
15 #include "bindings/tests/idls/TestImplements.h"
16 #include "bindings/tests/idls/TestImplements2Implementation.h"
17 #include "bindings/tests/idls/TestPartialInterfacePython.h"
18 #include "bindings/tests/idls/TestPartialInterfacePythonImplementation.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"
31
32 namespace WebCore {
33
34 static void initializeScriptWrappableForInterface(TestInterfacePythonImplementation* object)
35 {
36     if (ScriptWrappable::wrapperCanBeStoredInObject(object))
37         ScriptWrappable::setTypeInfoInObject(object, &V8TestInterfacePython::wrapperTypeInfo);
38     else
39         ASSERT_NOT_REACHED();
40 }
41
42 } // namespace WebCore
43
44 void webCoreInitializeScriptWrappableForInterface(WebCore::TestInterfacePythonImplementation* object)
45 {
46     WebCore::initializeScriptWrappableForInterface(object);
47 }
48
49 namespace WebCore {
50 const WrapperTypeInfo V8TestInterfacePython::wrapperTypeInfo = { gin::kEmbedderBlink, V8TestInterfacePython::domTemplate, V8TestInterfacePython::derefObject, V8TestInterfacePython::toActiveDOMObject, 0, V8TestInterfacePython::visitDOMWrapper, V8TestInterfacePython::installPerContextEnabledMethods, &V8TestInterfaceEmpty::wrapperTypeInfo, WrapperTypeObjectPrototype, false };
51
52 namespace TestInterfacePythonImplementationV8Internal {
53
54 template <typename T> void V8_USE(T) { }
55
56 static void testInterfacePythonAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
57 {
58     v8::Handle<v8::Object> holder = info.Holder();
59     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
60     v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfacePythonAttribute()), impl);
61 }
62
63 static void testInterfacePythonAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
64 {
65     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
66     TestInterfacePythonImplementationV8Internal::testInterfacePythonAttributeAttributeGetter(info);
67     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
68 }
69
70 static void testInterfacePythonAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
71 {
72     v8::Handle<v8::Object> holder = info.Holder();
73     ExceptionState exceptionState(ExceptionState::SetterContext, "testInterfacePythonAttribute", "TestInterfacePython", holder, info.GetIsolate());
74     if (!isUndefinedOrNull(v8Value) && !V8TestInterfacePython::hasInstance(v8Value, info.GetIsolate())) {
75         exceptionState.throwTypeError("The provided value is not of type 'TestInterfacePython'.");
76         exceptionState.throwIfNeeded();
77         return;
78     }
79     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
80     V8TRYCATCH_VOID(TestInterfacePythonImplementation*, cppValue, V8TestInterfacePython::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
81     impl->setTestInterfacePythonAttribute(WTF::getPtr(cppValue));
82 }
83
84 static void testInterfacePythonAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
85 {
86     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
87     TestInterfacePythonImplementationV8Internal::testInterfacePythonAttributeAttributeSetter(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, TestInterfacePythonImplementation::staticStringAttribute(), 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     TestInterfacePythonImplementationV8Internal::staticStringAttributeAttributeGetter(info);
100     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
101 }
102
103 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
104 {
105     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
106     TestInterfacePythonImplementation::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     TestInterfacePythonImplementationV8Internal::staticStringAttributeAttributeSetter(v8Value, info);
113     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
114 }
115
116 static void perWorldBindingsStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
117 {
118     v8::Handle<v8::Object> holder = info.Holder();
119     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
120     v8SetReturnValueString(info, impl->perWorldBindingsStringAttribute(), info.GetIsolate());
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     TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetter(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     TestInterfacePythonImplementation* impl = V8TestInterfacePython::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>& info)
139 {
140     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
141     TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetter(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     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
149     v8SetReturnValueString(info, impl->perWorldBindingsStringAttribute(), info.GetIsolate());
150 }
151
152 static void perWorldBindingsStringAttributeAttributeGetterCallbackForMainWorld(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
153 {
154     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
155     TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetterForMainWorld(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     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
163     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
164     impl->setPerWorldBindingsStringAttribute(cppValue);
165 }
166
167 static void perWorldBindingsStringAttributeAttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
168 {
169     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
170     TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterForMainWorld(v8Value, info);
171     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
172 }
173
174 static void implementsStaticReadOnlyLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
175 {
176     v8SetReturnValueInt(info, TestImplements::implementsStaticReadOnlyLongAttribute());
177 }
178
179 static void implementsStaticReadOnlyLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
180 {
181     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
182     TestInterfacePythonImplementationV8Internal::implementsStaticReadOnlyLongAttributeAttributeGetter(info);
183     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
184 }
185
186 static void implementsStaticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
187 {
188     v8SetReturnValueString(info, TestImplements::implementsStaticStringAttribute(), info.GetIsolate());
189 }
190
191 static void implementsStaticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
192 {
193     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
194     TestInterfacePythonImplementationV8Internal::implementsStaticStringAttributeAttributeGetter(info);
195     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
196 }
197
198 static void implementsStaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
199 {
200     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
201     TestImplements::setImplementsStaticStringAttribute(cppValue);
202 }
203
204 static void implementsStaticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
205 {
206     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
207     TestInterfacePythonImplementationV8Internal::implementsStaticStringAttributeAttributeSetter(v8Value, info);
208     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
209 }
210
211 static void implementsReadonlyStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
212 {
213     v8::Handle<v8::Object> holder = info.Holder();
214     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
215     ASSERT(impl);
216     v8SetReturnValueString(info, TestImplements::implementsReadonlyStringAttribute(*impl), info.GetIsolate());
217 }
218
219 static void implementsReadonlyStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
220 {
221     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
222     TestInterfacePythonImplementationV8Internal::implementsReadonlyStringAttributeAttributeGetter(info);
223     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
224 }
225
226 static void implementsStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
227 {
228     v8::Handle<v8::Object> holder = info.Holder();
229     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
230     ASSERT(impl);
231     v8SetReturnValueString(info, TestImplements::implementsStringAttribute(*impl), info.GetIsolate());
232 }
233
234 static void implementsStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
235 {
236     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
237     TestInterfacePythonImplementationV8Internal::implementsStringAttributeAttributeGetter(info);
238     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
239 }
240
241 static void implementsStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
242 {
243     v8::Handle<v8::Object> holder = info.Holder();
244     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
245     ASSERT(impl);
246     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
247     TestImplements::setImplementsStringAttribute(*impl, cppValue);
248 }
249
250 static void implementsStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
251 {
252     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
253     TestInterfacePythonImplementationV8Internal::implementsStringAttributeAttributeSetter(v8Value, info);
254     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
255 }
256
257 static void implementsNodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
258 {
259     v8::Handle<v8::Object> holder = info.Holder();
260     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
261     ASSERT(impl);
262     v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsNodeAttribute(*impl)), impl);
263 }
264
265 static void implementsNodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
266 {
267     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
268     TestInterfacePythonImplementationV8Internal::implementsNodeAttributeAttributeGetter(info);
269     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
270 }
271
272 static void implementsNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
273 {
274     v8::Handle<v8::Object> holder = info.Holder();
275     ExceptionState exceptionState(ExceptionState::SetterContext, "implementsNodeAttribute", "TestInterfacePython", holder, info.GetIsolate());
276     if (!isUndefinedOrNull(v8Value) && !V8Node::hasInstance(v8Value, info.GetIsolate())) {
277         exceptionState.throwTypeError("The provided value is not of type 'Node'.");
278         exceptionState.throwIfNeeded();
279         return;
280     }
281     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
282     ASSERT(impl);
283     V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
284     TestImplements::setImplementsNodeAttribute(*impl, WTF::getPtr(cppValue));
285 }
286
287 static void implementsNodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
288 {
289     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
290     TestInterfacePythonImplementationV8Internal::implementsNodeAttributeAttributeSetter(v8Value, info);
291     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
292 }
293
294 static void implementsEventHandlerAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
295 {
296     v8::Handle<v8::Object> holder = info.Holder();
297     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
298     ASSERT(impl);
299     EventListener* v8Value = TestImplements::implementsEventHandlerAttribute(*impl);
300     v8SetReturnValue(info, v8Value ? v8::Handle<v8::Value>(V8AbstractEventListener::cast(v8Value)->getListenerObject(impl->executionContext())) : v8::Handle<v8::Value>(v8::Null(info.GetIsolate())));
301 }
302
303 static void implementsEventHandlerAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
304 {
305     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
306     TestInterfacePythonImplementationV8Internal::implementsEventHandlerAttributeAttributeGetter(info);
307     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
308 }
309
310 static void implementsEventHandlerAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
311 {
312     v8::Handle<v8::Object> holder = info.Holder();
313     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
314     ASSERT(impl);
315     moveEventListenerToNewWrapper(holder, TestImplements::implementsEventHandlerAttribute(*impl), v8Value, V8TestInterfacePython::eventListenerCacheIndex, info.GetIsolate());
316     TestImplements::setImplementsEventHandlerAttribute(*impl, V8EventListenerList::getEventListener(v8Value, true, ListenerFindOrCreate));
317 }
318
319 static void implementsEventHandlerAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
320 {
321     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
322     TestInterfacePythonImplementationV8Internal::implementsEventHandlerAttributeAttributeSetter(v8Value, info);
323     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
324 }
325
326 static void implementsRuntimeEnabledNodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
327 {
328     v8::Handle<v8::Object> holder = info.Holder();
329     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
330     ASSERT(impl);
331     v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsRuntimeEnabledNodeAttribute(*impl)), impl);
332 }
333
334 static void implementsRuntimeEnabledNodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
335 {
336     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
337     TestInterfacePythonImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGetter(info);
338     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
339 }
340
341 static void implementsRuntimeEnabledNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
342 {
343     v8::Handle<v8::Object> holder = info.Holder();
344     ExceptionState exceptionState(ExceptionState::SetterContext, "implementsRuntimeEnabledNodeAttribute", "TestInterfacePython", holder, info.GetIsolate());
345     if (!isUndefinedOrNull(v8Value) && !V8Node::hasInstance(v8Value, info.GetIsolate())) {
346         exceptionState.throwTypeError("The provided value is not of type 'Node'.");
347         exceptionState.throwIfNeeded();
348         return;
349     }
350     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
351     ASSERT(impl);
352     V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
353     TestImplements::setImplementsRuntimeEnabledNodeAttribute(*impl, WTF::getPtr(cppValue));
354 }
355
356 static void implementsRuntimeEnabledNodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
357 {
358     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
359     TestInterfacePythonImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSetter(v8Value, info);
360     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
361 }
362
363 static void implementsPerContextEnabledNodeAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
364 {
365     v8::Handle<v8::Object> holder = info.Holder();
366     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
367     ASSERT(impl);
368     v8SetReturnValueFast(info, WTF::getPtr(TestImplements::implementsPerContextEnabledNodeAttribute(*impl)), impl);
369 }
370
371 static void implementsPerContextEnabledNodeAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
372 {
373     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
374     TestInterfacePythonImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeGetter(info);
375     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
376 }
377
378 static void implementsPerContextEnabledNodeAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
379 {
380     v8::Handle<v8::Object> holder = info.Holder();
381     ExceptionState exceptionState(ExceptionState::SetterContext, "implementsPerContextEnabledNodeAttribute", "TestInterfacePython", holder, info.GetIsolate());
382     if (!isUndefinedOrNull(v8Value) && !V8Node::hasInstance(v8Value, info.GetIsolate())) {
383         exceptionState.throwTypeError("The provided value is not of type 'Node'.");
384         exceptionState.throwIfNeeded();
385         return;
386     }
387     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
388     ASSERT(impl);
389     V8TRYCATCH_VOID(Node*, cppValue, V8Node::toNativeWithTypeCheck(info.GetIsolate(), v8Value));
390     TestImplements::setImplementsPerContextEnabledNodeAttribute(*impl, WTF::getPtr(cppValue));
391 }
392
393 static void implementsPerContextEnabledNodeAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
394 {
395     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
396     TestInterfacePythonImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeSetter(v8Value, info);
397     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
398 }
399
400 static void implements2StaticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
401 {
402     v8SetReturnValueString(info, TestImplements2Implementation::implements2StaticStringAttribute(), info.GetIsolate());
403 }
404
405 static void implements2StaticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
406 {
407     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
408     TestInterfacePythonImplementationV8Internal::implements2StaticStringAttributeAttributeGetter(info);
409     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
410 }
411
412 static void implements2StaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
413 {
414     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
415     TestImplements2Implementation::setImplements2StaticStringAttribute(cppValue);
416 }
417
418 static void implements2StaticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
419 {
420     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
421     TestInterfacePythonImplementationV8Internal::implements2StaticStringAttributeAttributeSetter(v8Value, info);
422     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
423 }
424
425 static void implements2StringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
426 {
427     v8::Handle<v8::Object> holder = info.Holder();
428     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
429     ASSERT(impl);
430     v8SetReturnValueString(info, TestImplements2Implementation::implements2StringAttribute(*impl), info.GetIsolate());
431 }
432
433 static void implements2StringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
434 {
435     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
436     TestInterfacePythonImplementationV8Internal::implements2StringAttributeAttributeGetter(info);
437     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
438 }
439
440 static void implements2StringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
441 {
442     v8::Handle<v8::Object> holder = info.Holder();
443     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
444     ASSERT(impl);
445     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
446     TestImplements2Implementation::setImplements2StringAttribute(*impl, cppValue);
447 }
448
449 static void implements2StringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
450 {
451     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
452     TestInterfacePythonImplementationV8Internal::implements2StringAttributeAttributeSetter(v8Value, info);
453     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
454 }
455
456 static void implements3StringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
457 {
458     v8::Handle<v8::Object> holder = info.Holder();
459     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
460     v8SetReturnValueString(info, impl->implements3StringAttribute(), info.GetIsolate());
461 }
462
463 static void implements3StringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
464 {
465     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
466     TestInterfacePythonImplementationV8Internal::implements3StringAttributeAttributeGetter(info);
467     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
468 }
469
470 static void implements3StringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
471 {
472     v8::Handle<v8::Object> holder = info.Holder();
473     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
474     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
475     impl->setImplements3StringAttribute(cppValue);
476 }
477
478 static void implements3StringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
479 {
480     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
481     TestInterfacePythonImplementationV8Internal::implements3StringAttributeAttributeSetter(v8Value, info);
482     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
483 }
484
485 static void implements3StaticStringAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
486 {
487     v8SetReturnValueString(info, TestInterfacePythonImplementation::implements3StaticStringAttribute(), info.GetIsolate());
488 }
489
490 static void implements3StaticStringAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
491 {
492     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
493     TestInterfacePythonImplementationV8Internal::implements3StaticStringAttributeAttributeGetter(info);
494     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
495 }
496
497 static void implements3StaticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
498 {
499     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, cppValue, v8Value);
500     TestInterfacePythonImplementation::setImplements3StaticStringAttribute(cppValue);
501 }
502
503 static void implements3StaticStringAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
504 {
505     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
506     TestInterfacePythonImplementationV8Internal::implements3StaticStringAttributeAttributeSetter(v8Value, info);
507     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
508 }
509
510 #if ENABLE(PARTIAL_CONDITION)
511 static void partialLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
512 {
513     v8::Handle<v8::Object> holder = info.Holder();
514     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
515     ASSERT(impl);
516     v8SetReturnValueInt(info, TestPartialInterfacePython::partialLongAttribute(*impl));
517 }
518 #endif // ENABLE(PARTIAL_CONDITION)
519
520 #if ENABLE(PARTIAL_CONDITION)
521 static void partialLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
522 {
523     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
524     TestInterfacePythonImplementationV8Internal::partialLongAttributeAttributeGetter(info);
525     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
526 }
527 #endif // ENABLE(PARTIAL_CONDITION)
528
529 #if ENABLE(PARTIAL_CONDITION)
530 static void partialLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
531 {
532     v8::Handle<v8::Object> holder = info.Holder();
533     ExceptionState exceptionState(ExceptionState::SetterContext, "partialLongAttribute", "TestInterfacePython", holder, info.GetIsolate());
534     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
535     ASSERT(impl);
536     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
537     TestPartialInterfacePython::setPartialLongAttribute(*impl, cppValue);
538 }
539 #endif // ENABLE(PARTIAL_CONDITION)
540
541 #if ENABLE(PARTIAL_CONDITION)
542 static void partialLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
543 {
544     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
545     TestInterfacePythonImplementationV8Internal::partialLongAttributeAttributeSetter(v8Value, 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::PropertyCallbackInfo<v8::Value>& info)
552 {
553     v8SetReturnValueInt(info, TestPartialInterfacePython::partialStaticLongAttribute());
554 }
555 #endif // ENABLE(PARTIAL_CONDITION)
556
557 #if ENABLE(PARTIAL_CONDITION)
558 static void partialStaticLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
559 {
560     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
561     TestInterfacePythonImplementationV8Internal::partialStaticLongAttributeAttributeGetter(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> v8Value, const v8::PropertyCallbackInfo<void>& info)
568 {
569     ExceptionState exceptionState(ExceptionState::SetterContext, "partialStaticLongAttribute", "TestInterfacePython", holder, info.GetIsolate());
570     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
571     TestPartialInterfacePython::setPartialStaticLongAttribute(cppValue);
572 }
573 #endif // ENABLE(PARTIAL_CONDITION)
574
575 #if ENABLE(PARTIAL_CONDITION)
576 static void partialStaticLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
577 {
578     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
579     TestInterfacePythonImplementationV8Internal::partialStaticLongAttributeAttributeSetter(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     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
589     ASSERT(impl);
590     ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
591     v8SetReturnValueInt(info, TestPartialInterfacePython::partialCallWithExecutionContextLongAttribute(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     TestInterfacePythonImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeGetter(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::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
606 {
607     v8::Handle<v8::Object> holder = info.Holder();
608     ExceptionState exceptionState(ExceptionState::SetterContext, "partialCallWithExecutionContextLongAttribute", "TestInterfacePython", holder, info.GetIsolate());
609     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
610     ASSERT(impl);
611     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
612     ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
613     TestPartialInterfacePython::setPartialCallWithExecutionContextLongAttribute(scriptContext, *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::PropertyCallbackInfo<void>& info)
619 {
620     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
621     TestInterfacePythonImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeSetter(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 enumAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
628 {
629     v8::Handle<v8::Object> holder = info.Holder();
630     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
631     ASSERT(impl);
632     v8SetReturnValueString(info, TestPartialInterfacePython::enumAttribute(*impl), info.GetIsolate());
633 }
634 #endif // ENABLE(PARTIAL_CONDITION)
635
636 #if ENABLE(PARTIAL_CONDITION)
637 static void enumAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
638 {
639     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
640     TestInterfacePythonImplementationV8Internal::enumAttributeAttributeGetter(info);
641     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
642 }
643 #endif // ENABLE(PARTIAL_CONDITION)
644
645 #if ENABLE(PARTIAL_CONDITION)
646 static void enumAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
647 {
648     v8::Handle<v8::Object> holder = info.Holder();
649     TestInterfacePythonImplementation* impl = V8TestInterfacePython::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     TestPartialInterfacePython::setEnumAttribute(*impl, cppValue);
656 }
657 #endif // ENABLE(PARTIAL_CONDITION)
658
659 #if ENABLE(PARTIAL_CONDITION)
660 static void enumAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
661 {
662     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
663     TestInterfacePythonImplementationV8Internal::enumAttributeAttributeSetter(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     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
672     ASSERT(impl);
673     v8SetReturnValueInt(info, TestPartialInterfacePythonImplementation::partial2LongAttribute(*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     TestInterfacePythonImplementationV8Internal::partial2LongAttributeAttributeGetter(info);
680     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
681 }
682
683 static void partial2LongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
684 {
685     v8::Handle<v8::Object> holder = info.Holder();
686     ExceptionState exceptionState(ExceptionState::SetterContext, "partial2LongAttribute", "TestInterfacePython", holder, info.GetIsolate());
687     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(holder);
688     ASSERT(impl);
689     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
690     TestPartialInterfacePythonImplementation::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     TestInterfacePythonImplementationV8Internal::partial2LongAttributeAttributeSetter(v8Value, info);
697     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
698 }
699
700 static void partial2StaticLongAttributeAttributeGetter(const v8::PropertyCallbackInfo<v8::Value>& info)
701 {
702     v8SetReturnValueInt(info, TestPartialInterfacePythonImplementation::partial2StaticLongAttribute());
703 }
704
705 static void partial2StaticLongAttributeAttributeGetterCallback(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info)
706 {
707     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter");
708     TestInterfacePythonImplementationV8Internal::partial2StaticLongAttributeAttributeGetter(info);
709     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
710 }
711
712 static void partial2StaticLongAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
713 {
714     ExceptionState exceptionState(ExceptionState::SetterContext, "partial2StaticLongAttribute", "TestInterfacePython", holder, info.GetIsolate());
715     V8TRYCATCH_EXCEPTION_VOID(int, cppValue, toInt32(v8Value, exceptionState), exceptionState);
716     TestPartialInterfacePythonImplementation::setPartial2StaticLongAttribute(cppValue);
717 }
718
719 static void partial2StaticLongAttributeAttributeSetterCallback(v8::Local<v8::String>, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
720 {
721     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter");
722     TestInterfacePythonImplementationV8Internal::partial2StaticLongAttributeAttributeSetter(v8Value, info);
723     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
724 }
725
726 static void TestInterfacePythonImplementationConstructorGetter(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()->CreationContext());
731     if (!perContextData)
732         return;
733     v8SetReturnValue(info, perContextData->constructorForType(WrapperTypeInfo::unwrap(data)));
734 }
735
736 static void TestInterfacePythonImplementationReplaceableAttributeSetter(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 TestInterfacePythonImplementationReplaceableAttributeSetterCallback(v8::Local<v8::String> name, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<void>& info)
742 {
743     TestInterfacePythonImplementationV8Internal::TestInterfacePythonImplementationReplaceableAttributeSetter(name, v8Value, info);
744 }
745
746 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
747 {
748     if (UNLIKELY(info.Length() < 1)) {
749         throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterfacePython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
750         return;
751     }
752     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
753     if (info.Length() > 0 && !V8TestInterfaceEmpty::hasInstance(info[0], info.GetIsolate())) {
754         throwTypeError(ExceptionMessages::failedToExecute("voidMethodTestInterfaceEmptyArg", "TestInterfacePython", "parameter 1 is not of type 'TestInterfaceEmpty'."), info.GetIsolate());
755         return;
756     }
757     V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[0]));
758     impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
759 }
760
761 static void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
762 {
763     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
764     TestInterfacePythonImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod(info);
765     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
766 }
767
768 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
769 {
770     TestInterfacePythonImplementation* impl = V8TestInterfacePython::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     TestInterfacePythonImplementationV8Internal::voidMethodMethod(info);
778     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
779 }
780
781 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Value>& info)
782 {
783     TestInterfacePythonImplementation* impl = V8TestInterfacePython::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     TestInterfacePythonImplementationV8Internal::voidMethodMethodForMainWorld(info);
791     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
792 }
793
794 static void implementsVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
795 {
796     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
797     ASSERT(impl);
798     TestImplements::implementsVoidMethod(*impl);
799 }
800
801 static void implementsVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
802 {
803     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
804     TestInterfacePythonImplementationV8Internal::implementsVoidMethodMethod(info);
805     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
806 }
807
808 static void implementsComplexMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
809 {
810     ExceptionState exceptionState(ExceptionState::ExecutionContext, "implementsComplexMethod", "TestInterfacePython", info.Holder(), info.GetIsolate());
811     if (UNLIKELY(info.Length() < 2)) {
812         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info.Length()));
813         exceptionState.throwIfNeeded();
814         return;
815     }
816     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
817     V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<>, strArg, info[0]);
818     if (info.Length() > 1 && !V8TestInterfaceEmpty::hasInstance(info[1], info.GetIsolate())) {
819         exceptionState.throwTypeError("parameter 2 is not of type 'TestInterfaceEmpty'.");
820         exceptionState.throwIfNeeded();
821         return;
822     }
823     V8TRYCATCH_VOID(TestInterfaceEmpty*, testInterfaceEmptyArg, V8TestInterfaceEmpty::toNativeWithTypeCheck(info.GetIsolate(), info[1]));
824     ASSERT(impl);
825     ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
826     RefPtr<TestInterfaceEmpty> result = TestImplements::implementsComplexMethod(scriptContext, *impl, strArg, testInterfaceEmptyArg, exceptionState);
827     if (exceptionState.throwIfNeeded())
828         return;
829     v8SetReturnValue(info, result.release());
830 }
831
832 static void implementsComplexMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
833 {
834     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
835     TestInterfacePythonImplementationV8Internal::implementsComplexMethodMethod(info);
836     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
837 }
838
839 static void implementsCustomVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
840 {
841     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
842     V8TestInterfacePython::implementsCustomVoidMethodMethodCustom(info);
843     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
844 }
845
846 static void implementsStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
847 {
848     TestImplements::implementsStaticVoidMethod();
849 }
850
851 static void implementsStaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
852 {
853     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
854     TestInterfacePythonImplementationV8Internal::implementsStaticVoidMethodMethod(info);
855     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
856 }
857
858 static void implements2VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
859 {
860     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
861     ASSERT(impl);
862     TestImplements2Implementation::implements2VoidMethod(*impl);
863 }
864
865 static void implements2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
866 {
867     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
868     TestInterfacePythonImplementationV8Internal::implements2VoidMethodMethod(info);
869     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
870 }
871
872 static void implements3VoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
873 {
874     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
875     impl->implements3VoidMethod();
876 }
877
878 static void implements3VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
879 {
880     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
881     TestInterfacePythonImplementationV8Internal::implements3VoidMethodMethod(info);
882     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
883 }
884
885 static void implements3StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
886 {
887     TestInterfacePythonImplementation::implements3StaticVoidMethod();
888 }
889
890 static void implements3StaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
891 {
892     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
893     TestInterfacePythonImplementationV8Internal::implements3StaticVoidMethodMethod(info);
894     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
895 }
896
897 #if ENABLE(PARTIAL_CONDITION)
898 static void partialVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
899 {
900     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
901     ASSERT(impl);
902     TestPartialInterfacePython::partialVoidMethod(*impl);
903 }
904 #endif // ENABLE(PARTIAL_CONDITION)
905
906 #if ENABLE(PARTIAL_CONDITION)
907 static void partialVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
908 {
909     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
910     TestInterfacePythonImplementationV8Internal::partialVoidMethodMethod(info);
911     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
912 }
913 #endif // ENABLE(PARTIAL_CONDITION)
914
915 #if ENABLE(PARTIAL_CONDITION)
916 static void partialStaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
917 {
918     TestPartialInterfacePython::partialStaticVoidMethod();
919 }
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     TestInterfacePythonImplementationV8Internal::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::Value>& info)
933 {
934     ExceptionState exceptionState(ExceptionState::ExecutionContext, "partialVoidMethodLongArg", "TestInterfacePython", info.Holder(), info.GetIsolate());
935     if (UNLIKELY(info.Length() < 1)) {
936         exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info.Length()));
937         exceptionState.throwIfNeeded();
938         return;
939     }
940     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
941     V8TRYCATCH_EXCEPTION_VOID(int, longArg, toInt32(info[0], exceptionState), exceptionState);
942     ASSERT(impl);
943     TestPartialInterfacePython::partialVoidMethodLongArg(*impl, longArg);
944 }
945 #endif // ENABLE(PARTIAL_CONDITION)
946
947 #if ENABLE(PARTIAL_CONDITION)
948 static void partialVoidMethodLongArgMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
949 {
950     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
951     TestInterfacePythonImplementationV8Internal::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, "partialCallWithExecutionContextRaisesExceptionVoidMethod", "TestInterfacePython", info.Holder(), info.GetIsolate());
960     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
961     ASSERT(impl);
962     ExecutionContext* scriptContext = currentExecutionContext(info.GetIsolate());
963     TestPartialInterfacePython::partialCallWithExecutionContextRaisesExceptionVoidMethod(scriptContext, *impl, exceptionState);
964     if (exceptionState.throwIfNeeded())
965         return;
966 }
967 #endif // ENABLE(PARTIAL_CONDITION)
968
969 #if ENABLE(PARTIAL_CONDITION)
970 static void partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
971 {
972     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
973     TestInterfacePythonImplementationV8Internal::partialCallWithExecutionContextRaisesExceptionVoidMethodMethod(info);
974     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
975 }
976 #endif // ENABLE(PARTIAL_CONDITION)
977
978 #if ENABLE(PARTIAL_CONDITION)
979 static void methodThatTakesCallbackMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
980 {
981     if (UNLIKELY(info.Length() < 1)) {
982         throwTypeError(ExceptionMessages::failedToExecute("methodThatTakesCallback", "TestInterfacePython", ExceptionMessages::notEnoughArguments(1, info.Length())), info.GetIsolate());
983         return;
984     }
985     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
986     V8TRYCATCH_VOID(ScriptValue, callback, ScriptValue(info[0], info.GetIsolate()));
987     ASSERT(impl);
988     TestPartialInterfacePython::methodThatTakesCallback(*impl, callback);
989 }
990 #endif // ENABLE(PARTIAL_CONDITION)
991
992 #if ENABLE(PARTIAL_CONDITION)
993 static void methodThatTakesCallbackMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
994 {
995     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
996     TestInterfacePythonImplementationV8Internal::methodThatTakesCallbackMethod(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     TestInterfacePythonImplementation* impl = V8TestInterfacePython::toNative(info.Holder());
1004     ASSERT(impl);
1005     TestPartialInterfacePythonImplementation::partial2VoidMethod(*impl);
1006 }
1007
1008 static void partial2VoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1009 {
1010     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1011     TestInterfacePythonImplementationV8Internal::partial2VoidMethodMethod(info);
1012     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1013 }
1014
1015 static void partial2StaticVoidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1016 {
1017     TestPartialInterfacePythonImplementation::partial2StaticVoidMethod();
1018 }
1019
1020 static void partial2StaticVoidMethodMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& info)
1021 {
1022     TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod");
1023     TestInterfacePythonImplementationV8Internal::partial2StaticVoidMethodMethod(info);
1024     TRACE_EVENT_SET_SAMPLING_STATE("V8", "V8Execution");
1025 }
1026
1027 } // namespace TestInterfacePythonImplementationV8Internal
1028
1029 void V8TestInterfacePython::visitDOMWrapper(void* object, const v8::Persistent<v8::Object>& wrapper, v8::Isolate* isolate)
1030 {
1031     TestInterfacePythonImplementation* impl = fromInternalPointer(object);
1032     v8::Local<v8::Object> creationContext = v8::Local<v8::Object>::New(isolate, wrapper);
1033     V8WrapperInstantiationScope scope(creationContext, isolate);
1034     TestInterfacePythonImplementation* referencedName = impl->referencedName();
1035     if (referencedName) {
1036         if (!DOMDataStore::containsWrapper<V8TestInterfacePython>(referencedName, isolate))
1037             wrap(referencedName, creationContext, isolate);
1038         DOMDataStore::setWrapperReference<V8TestInterfacePython>(wrapper, referencedName, isolate);
1039     }
1040     setObjectGroup(object, wrapper, isolate);
1041 }
1042
1043 static const V8DOMConfiguration::AttributeConfiguration V8TestInterfacePythonAttributes[] = {
1044     {"testInterfacePythonAttribute", TestInterfacePythonImplementationV8Internal::testInterfacePythonAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::testInterfacePythonAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1045     {"testImplementedAsConstructorAttribute", TestInterfacePythonImplementationV8Internal::TestInterfacePythonImplementationConstructorGetter, TestInterfacePythonImplementationV8Internal::TestInterfacePythonImplementationReplaceableAttributeSetterCallback, 0, 0, const_cast<WrapperTypeInfo*>(&V8TestImplementedAs::wrapperTypeInfo), static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::DontEnum), 0 /* on instance */},
1046     {"perWorldBindingsStringAttribute", TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterCallback, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeGetterCallbackForMainWorld, TestInterfacePythonImplementationV8Internal::perWorldBindingsStringAttributeAttributeSetterCallbackForMainWorld, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1047     {"implementsReadonlyStringAttribute", TestInterfacePythonImplementationV8Internal::implementsReadonlyStringAttributeAttributeGetterCallback, 0, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1048     {"implementsStringAttribute", TestInterfacePythonImplementationV8Internal::implementsStringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implementsStringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1049     {"implementsNodeAttribute", TestInterfacePythonImplementationV8Internal::implementsNodeAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implementsNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1050     {"implementsEventHandlerAttribute", TestInterfacePythonImplementationV8Internal::implementsEventHandlerAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implementsEventHandlerAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1051     {"implements3StringAttribute", TestInterfacePythonImplementationV8Internal::implements3StringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implements3StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1052     {"partial2LongAttribute", TestInterfacePythonImplementationV8Internal::partial2LongAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::partial2LongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */},
1053 };
1054
1055 static const V8DOMConfiguration::MethodConfiguration V8TestInterfacePythonMethods[] = {
1056     {"voidMethodTestInterfaceEmptyArg", TestInterfacePythonImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1},
1057     {"voidMethod", TestInterfacePythonImplementationV8Internal::voidMethodMethodCallback, TestInterfacePythonImplementationV8Internal::voidMethodMethodCallbackForMainWorld, 0},
1058     {"implementsVoidMethod", TestInterfacePythonImplementationV8Internal::implementsVoidMethodMethodCallback, 0, 0},
1059     {"implementsComplexMethod", TestInterfacePythonImplementationV8Internal::implementsComplexMethodMethodCallback, 0, 2},
1060     {"implementsCustomVoidMethod", TestInterfacePythonImplementationV8Internal::implementsCustomVoidMethodMethodCallback, 0, 0},
1061     {"implements3VoidMethod", TestInterfacePythonImplementationV8Internal::implements3VoidMethodMethodCallback, 0, 0},
1062     {"partial2VoidMethod", TestInterfacePythonImplementationV8Internal::partial2VoidMethodMethodCallback, 0, 0},
1063 };
1064
1065 static void configureV8TestInterfacePythonTemplate(v8::Handle<v8::FunctionTemplate> functionTemplate, v8::Isolate* isolate)
1066 {
1067     functionTemplate->ReadOnlyPrototype();
1068
1069     v8::Local<v8::Signature> defaultSignature;
1070     if (!RuntimeEnabledFeatures::featureNameEnabled())
1071         defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterfacePython::internalFieldCount, 0, 0, 0, 0, 0, 0, isolate);
1072     else
1073         defaultSignature = V8DOMConfiguration::installDOMClassTemplate(functionTemplate, "TestInterfacePython", V8TestInterfaceEmpty::domTemplate(isolate), V8TestInterfacePython::internalFieldCount,
1074             V8TestInterfacePythonAttributes, WTF_ARRAY_LENGTH(V8TestInterfacePythonAttributes),
1075             0, 0,
1076             V8TestInterfacePythonMethods, WTF_ARRAY_LENGTH(V8TestInterfacePythonMethods),
1077             isolate);
1078     v8::Local<v8::ObjectTemplate> ALLOW_UNUSED instanceTemplate = functionTemplate->InstanceTemplate();
1079     v8::Local<v8::ObjectTemplate> ALLOW_UNUSED prototypeTemplate = functionTemplate->PrototypeTemplate();
1080     if (RuntimeEnabledFeatures::implementsFeatureNameEnabled()) {
1081         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1082         {"implementsRuntimeEnabledNodeAttribute", TestInterfacePythonImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implementsRuntimeEnabledNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1083         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1084     }
1085     if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) {
1086         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1087         {"implements2StringAttribute", TestInterfacePythonImplementationV8Internal::implements2StringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implements2StringAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1088         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1089     }
1090 #if ENABLE(PARTIAL_CONDITION)
1091     if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1092         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1093         {"partialLongAttribute", TestInterfacePythonImplementationV8Internal::partialLongAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::partialLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1094         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1095     }
1096 #endif // ENABLE(PARTIAL_CONDITION)
1097 #if ENABLE(PARTIAL_CONDITION)
1098     if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1099         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1100         {"partialCallWithExecutionContextLongAttribute", TestInterfacePythonImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::partialCallWithExecutionContextLongAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1101         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1102     }
1103 #endif // ENABLE(PARTIAL_CONDITION)
1104 #if ENABLE(PARTIAL_CONDITION)
1105     if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1106         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1107         {"enumAttribute", TestInterfacePythonImplementationV8Internal::enumAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::enumAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1108         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1109     }
1110 #endif // ENABLE(PARTIAL_CONDITION)
1111     static const V8DOMConfiguration::ConstantConfiguration V8TestInterfacePythonConstants[] = {
1112         {"UNSIGNED_LONG", 0},
1113         {"IMPLEMENTS_CONSTANT_1", 1},
1114         {"IMPLEMENTS_CONSTANT_2", 2},
1115         {"PARTIAL2_UNSIGNED_SHORT", 0},
1116     };
1117     V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8TestInterfacePythonConstants, WTF_ARRAY_LENGTH(V8TestInterfacePythonConstants), isolate);
1118     if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1119         static const V8DOMConfiguration::ConstantConfiguration constantConfiguration = {"PARTIAL_UNSIGNED_SHORT", static_cast<signed int>(0)};
1120         V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, &constantConfiguration, 1, isolate);
1121     }
1122     COMPILE_ASSERT(0 == TestInterfacePythonImplementation::UNSIGNED_LONG, TheValueOfTestInterfacePythonImplementation_UNSIGNED_LONGDoesntMatchWithImplementation);
1123     COMPILE_ASSERT(1 == TestImplements::IMPLEMENTS_CONSTANT_1, TheValueOfTestInterfacePythonImplementation_IMPLEMENTS_CONSTANT_1DoesntMatchWithImplementation);
1124     COMPILE_ASSERT(2 == TestImplements::IMPLEMENTS_REFLECT_CONSTANT, TheValueOfTestInterfacePythonImplementation_IMPLEMENTS_REFLECT_CONSTANTDoesntMatchWithImplementation);
1125     COMPILE_ASSERT(0 == TestPartialInterfacePython::PARTIAL_UNSIGNED_SHORT, TheValueOfTestInterfacePythonImplementation_PARTIAL_UNSIGNED_SHORTDoesntMatchWithImplementation);
1126     COMPILE_ASSERT(0 == TestPartialInterfacePythonImplementation::PARTIAL2_UNSIGNED_SHORT, TheValueOfTestInterfacePythonImplementation_PARTIAL2_UNSIGNED_SHORTDoesntMatchWithImplementation);
1127     functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfacePython::legacyCallCustom);
1128     functionTemplate->Set(v8AtomicString(isolate, "implementsStaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::implementsStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1129     if (RuntimeEnabledFeatures::implements2FeatureNameEnabled())
1130         prototypeTemplate->Set(v8AtomicString(isolate, "implements2VoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::implements2VoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
1131     functionTemplate->Set(v8AtomicString(isolate, "implements3StaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::implements3StaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1132 #if ENABLE(PARTIAL_CONDITION)
1133     if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1134         prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::partialVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
1135 #endif // ENABLE(PARTIAL_CONDITION)
1136 #if ENABLE(PARTIAL_CONDITION)
1137     if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1138         functionTemplate->Set(v8AtomicString(isolate, "partialStaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::partialStaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1139 #endif // ENABLE(PARTIAL_CONDITION)
1140 #if ENABLE(PARTIAL_CONDITION)
1141     if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1142         prototypeTemplate->Set(v8AtomicString(isolate, "partialVoidMethodLongArg"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::partialVoidMethodLongArgMethodCallback, v8Undefined(), defaultSignature, 1));
1143 #endif // ENABLE(PARTIAL_CONDITION)
1144 #if ENABLE(PARTIAL_CONDITION)
1145     if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1146         prototypeTemplate->Set(v8AtomicString(isolate, "partialCallWithExecutionContextRaisesExceptionVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::partialCallWithExecutionContextRaisesExceptionVoidMethodMethodCallback, v8Undefined(), defaultSignature, 0));
1147 #endif // ENABLE(PARTIAL_CONDITION)
1148 #if ENABLE(PARTIAL_CONDITION)
1149     if (RuntimeEnabledFeatures::partialFeatureNameEnabled())
1150         prototypeTemplate->Set(v8AtomicString(isolate, "methodThatTakesCallback"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::methodThatTakesCallbackMethodCallback, v8Undefined(), defaultSignature, 1));
1151 #endif // ENABLE(PARTIAL_CONDITION)
1152     functionTemplate->Set(v8AtomicString(isolate, "partial2StaticVoidMethod"), v8::FunctionTemplate::New(isolate, TestInterfacePythonImplementationV8Internal::partial2StaticVoidMethodMethodCallback, v8Undefined(), v8::Local<v8::Signature>(), 0));
1153     functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "staticStringAttribute"), TestInterfacePythonImplementationV8Internal::staticStringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::staticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1154     functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsStaticReadOnlyLongAttribute"), TestInterfacePythonImplementationV8Internal::implementsStaticReadOnlyLongAttributeAttributeGetterCallback, 0, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1155     functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implementsStaticStringAttribute"), TestInterfacePythonImplementationV8Internal::implementsStaticStringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implementsStaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1156     functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements2StaticStringAttribute"), TestInterfacePythonImplementationV8Internal::implements2StaticStringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implements2StaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1157     functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "implements3StaticStringAttribute"), TestInterfacePythonImplementationV8Internal::implements3StaticStringAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implements3StaticStringAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1158 #if ENABLE(PARTIAL_CONDITION)
1159     functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "partialStaticLongAttribute"), TestInterfacePythonImplementationV8Internal::partialStaticLongAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::partialStaticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1160 #endif // ENABLE(PARTIAL_CONDITION)
1161     functionTemplate->SetNativeDataProperty(v8AtomicString(isolate, "partial2StaticLongAttribute"), TestInterfacePythonImplementationV8Internal::partial2StaticLongAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::partial2StaticLongAttributeAttributeSetterCallback, v8::External::New(isolate, 0), static_cast<v8::PropertyAttribute>(v8::None), v8::Handle<v8::AccessorSignature>(), static_cast<v8::AccessControl>(v8::DEFAULT));
1162
1163     // Custom toString template
1164     functionTemplate->Set(v8AtomicString(isolate, "toString"), V8PerIsolateData::current()->toStringTemplate());
1165 }
1166
1167 v8::Handle<v8::FunctionTemplate> V8TestInterfacePython::domTemplate(v8::Isolate* isolate)
1168 {
1169     V8PerIsolateData* data = V8PerIsolateData::from(isolate);
1170     v8::Local<v8::FunctionTemplate> result = data->existingDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo));
1171     if (!result.IsEmpty())
1172         return result;
1173
1174     TRACE_EVENT_SCOPED_SAMPLING_STATE("Blink", "BuildDOMTemplate");
1175     result = v8::FunctionTemplate::New(isolate, V8ObjectConstructor::isValidConstructorMode);
1176     configureV8TestInterfacePythonTemplate(result, isolate);
1177     data->setDOMTemplate(const_cast<WrapperTypeInfo*>(&wrapperTypeInfo), result);
1178     return result;
1179 }
1180
1181 bool V8TestInterfacePython::hasInstance(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
1182 {
1183     return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value);
1184 }
1185
1186 v8::Handle<v8::Object> V8TestInterfacePython::findInstanceInPrototypeChain(v8::Handle<v8::Value> v8Value, v8::Isolate* isolate)
1187 {
1188     return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperTypeInfo, v8Value);
1189 }
1190
1191 TestInterfacePythonImplementation* V8TestInterfacePython::toNativeWithTypeCheck(v8::Isolate* isolate, v8::Handle<v8::Value> value)
1192 {
1193     return hasInstance(value, isolate) ? fromInternalPointer(v8::Handle<v8::Object>::Cast(value)->GetAlignedPointerFromInternalField(v8DOMWrapperObjectIndex)) : 0;
1194 }
1195
1196 void V8TestInterfacePython::installPerContextEnabledProperties(v8::Handle<v8::Object> instanceTemplate, TestInterfacePythonImplementation* impl, v8::Isolate* isolate)
1197 {
1198     v8::Local<v8::Object> prototypeTemplate = v8::Local<v8::Object>::Cast(instanceTemplate->GetPrototype());
1199     if (ContextFeatures::implementsContextNameEnabled(impl->document())) {
1200         static const V8DOMConfiguration::AttributeConfiguration attributeConfiguration =\
1201         {"implementsPerContextEnabledNodeAttribute", TestInterfacePythonImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeGetterCallback, TestInterfacePythonImplementationV8Internal::implementsPerContextEnabledNodeAttributeAttributeSetterCallback, 0, 0, 0, static_cast<v8::AccessControl>(v8::DEFAULT), static_cast<v8::PropertyAttribute>(v8::None), 0 /* on instance */};
1202         V8DOMConfiguration::installAttribute(instanceTemplate, prototypeTemplate, attributeConfiguration, isolate);
1203     }
1204 }
1205
1206 ActiveDOMObject* V8TestInterfacePython::toActiveDOMObject(v8::Handle<v8::Object> wrapper)
1207 {
1208     return toNative(wrapper);
1209 }
1210
1211 void V8TestInterfacePython::derefObject(void* object)
1212 {
1213     fromInternalPointer(object)->deref();
1214 }
1215
1216 template<>
1217 v8::Handle<v8::Value> toV8NoInline(TestInterfacePythonImplementation* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate)
1218 {
1219     return toV8(impl, creationContext, isolate);
1220 }
1221
1222 } // namespace WebCore
1223 #endif // ENABLE(CONDITION)