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