Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(265)

Side by Side Diff: third_party/WebKit/Source/bindings/tests/results/modules/V8TestInterface5.cpp

Issue 2653883006: [bindings] Move callback functions from V8FooInternal namespace to V8Foo class (Closed)
Patch Set: Revert expose change Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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. 5 // This file has been auto-generated by code_generator_v8.py.
6 // DO NOT MODIFY! 6 // DO NOT MODIFY!
7 7
8 // This file has been generated from the Jinja2 template in 8 // This file has been generated from the Jinja2 template in
9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl 9 // third_party/WebKit/Source/bindings/templates/interface.cpp.tmpl
10 10
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 namespace TestInterface5ImplementationV8Internal { 62 namespace TestInterface5ImplementationV8Internal {
63 63
64 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) { 64 static void testInterfaceAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) {
65 v8::Local<v8::Object> holder = info.Holder(); 65 v8::Local<v8::Object> holder = info.Holder();
66 66
67 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 67 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
68 68
69 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl); 69 v8SetReturnValueFast(info, WTF::getPtr(impl->testInterfaceAttribute()), impl);
70 } 70 }
71 71
72 MODULES_EXPORT void testInterfaceAttributeAttributeGetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
73 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter( info);
74 }
75
76 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) { 72 static void testInterfaceAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
77 v8::Local<v8::Object> holder = info.Holder(); 73 v8::Local<v8::Object> holder = info.Holder();
78 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 74 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
79 75
80 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "testInterfaceAttribute"); 76 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "testInterfaceAttribute");
81 77
82 // Prepare the value to be set. 78 // Prepare the value to be set.
83 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeCheck (info.GetIsolate(), v8Value); 79 TestInterface5Implementation* cppValue = V8TestInterface5::toImplWithTypeCheck (info.GetIsolate(), v8Value);
84 80
85 // Type check per: http://heycam.github.io/webidl/#es-interface 81 // Type check per: http://heycam.github.io/webidl/#es-interface
86 if (!cppValue) { 82 if (!cppValue) {
87 exceptionState.throwTypeError("The provided value is not of type 'TestInterf ace5'."); 83 exceptionState.throwTypeError("The provided value is not of type 'TestInterf ace5'.");
88 return; 84 return;
89 } 85 }
90 86
91 impl->setTestInterfaceAttribute(cppValue); 87 impl->setTestInterfaceAttribute(cppValue);
92 } 88 }
93 89
94 MODULES_EXPORT void testInterfaceAttributeAttributeSetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
95 v8::Local<v8::Value> v8Value = info[0];
96
97 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter( v8Value, info);
98 }
99
100 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info) { 90 static void doubleAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Va lue>& info) {
101 v8::Local<v8::Object> holder = info.Holder(); 91 v8::Local<v8::Object> holder = info.Holder();
102 92
103 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 93 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
104 94
105 v8SetReturnValue(info, impl->doubleAttribute()); 95 v8SetReturnValue(info, impl->doubleAttribute());
106 } 96 }
107 97
108 MODULES_EXPORT void doubleAttributeAttributeGetterCallback(const v8::FunctionCal lbackInfo<v8::Value>& info) {
109 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info);
110 }
111
112 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::FunctionCallbackInfo<v8::Value>& info) { 98 static void doubleAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v 8::FunctionCallbackInfo<v8::Value>& info) {
113 v8::Local<v8::Object> holder = info.Holder(); 99 v8::Local<v8::Object> holder = info.Holder();
114 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 100 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
115 101
116 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "doubleAttribute"); 102 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "doubleAttribute");
117 103
118 // Prepare the value to be set. 104 // Prepare the value to be set.
119 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionStat e); 105 double cppValue = toRestrictedDouble(info.GetIsolate(), v8Value, exceptionStat e);
120 if (exceptionState.hadException()) 106 if (exceptionState.hadException())
121 return; 107 return;
122 108
123 impl->setDoubleAttribute(cppValue); 109 impl->setDoubleAttribute(cppValue);
124 } 110 }
125 111
126 MODULES_EXPORT void doubleAttributeAttributeSetterCallback(const v8::FunctionCal lbackInfo<v8::Value>& info) {
127 v8::Local<v8::Value> v8Value = info[0];
128
129 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value , info);
130 }
131
132 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val ue>& info) { 112 static void floatAttributeAttributeGetter(const v8::FunctionCallbackInfo<v8::Val ue>& info) {
133 v8::Local<v8::Object> holder = info.Holder(); 113 v8::Local<v8::Object> holder = info.Holder();
134 114
135 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 115 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
136 116
137 v8SetReturnValue(info, impl->floatAttribute()); 117 v8SetReturnValue(info, impl->floatAttribute());
138 } 118 }
139 119
140 MODULES_EXPORT void floatAttributeAttributeGetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) {
141 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info);
142 }
143
144 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::FunctionCallbackInfo<v8::Value>& info) { 120 static void floatAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8 ::FunctionCallbackInfo<v8::Value>& info) {
145 v8::Local<v8::Object> holder = info.Holder(); 121 v8::Local<v8::Object> holder = info.Holder();
146 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 122 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
147 123
148 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "floatAttribute"); 124 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "floatAttribute");
149 125
150 // Prepare the value to be set. 126 // Prepare the value to be set.
151 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState) ; 127 float cppValue = toRestrictedFloat(info.GetIsolate(), v8Value, exceptionState) ;
152 if (exceptionState.hadException()) 128 if (exceptionState.hadException())
153 return; 129 return;
154 130
155 impl->setFloatAttribute(cppValue); 131 impl->setFloatAttribute(cppValue);
156 } 132 }
157 133
158 MODULES_EXPORT void floatAttributeAttributeSetterCallback(const v8::FunctionCall backInfo<v8::Value>& info) {
159 v8::Local<v8::Value> v8Value = info[0];
160
161 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value, info);
162 }
163
164 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac kInfo<v8::Value>& info) { 134 static void unrestrictedDoubleAttributeAttributeGetter(const v8::FunctionCallbac kInfo<v8::Value>& info) {
165 v8::Local<v8::Object> holder = info.Holder(); 135 v8::Local<v8::Object> holder = info.Holder();
166 136
167 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 137 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
168 138
169 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute()); 139 v8SetReturnValue(info, impl->unrestrictedDoubleAttribute());
170 } 140 }
171 141
172 MODULES_EXPORT void unrestrictedDoubleAttributeAttributeGetterCallback(const v8: :FunctionCallbackInfo<v8::Value>& info) {
173 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGe tter(info);
174 }
175
176 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::FunctionCallbackInfo<v8::Value>& info) { 142 static void unrestrictedDoubleAttributeAttributeSetter(v8::Local<v8::Value> v8Va lue, const v8::FunctionCallbackInfo<v8::Value>& info) {
177 v8::Local<v8::Object> holder = info.Holder(); 143 v8::Local<v8::Object> holder = info.Holder();
178 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 144 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
179 145
180 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "unrestrictedDoubleAttribute"); 146 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "unrestrictedDoubleAttribute");
181 147
182 // Prepare the value to be set. 148 // Prepare the value to be set.
183 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState); 149 double cppValue = toDouble(info.GetIsolate(), v8Value, exceptionState);
184 if (exceptionState.hadException()) 150 if (exceptionState.hadException())
185 return; 151 return;
186 152
187 impl->setUnrestrictedDoubleAttribute(cppValue); 153 impl->setUnrestrictedDoubleAttribute(cppValue);
188 } 154 }
189 155
190 MODULES_EXPORT void unrestrictedDoubleAttributeAttributeSetterCallback(const v8: :FunctionCallbackInfo<v8::Value>& info) {
191 v8::Local<v8::Value> v8Value = info[0];
192
193 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSe tter(v8Value, info);
194 }
195
196 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback Info<v8::Value>& info) { 156 static void unrestrictedFloatAttributeAttributeGetter(const v8::FunctionCallback Info<v8::Value>& info) {
197 v8::Local<v8::Object> holder = info.Holder(); 157 v8::Local<v8::Object> holder = info.Holder();
198 158
199 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 159 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
200 160
201 v8SetReturnValue(info, impl->unrestrictedFloatAttribute()); 161 v8SetReturnValue(info, impl->unrestrictedFloatAttribute());
202 } 162 }
203 163
204 MODULES_EXPORT void unrestrictedFloatAttributeAttributeGetterCallback(const v8:: FunctionCallbackInfo<v8::Value>& info) {
205 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGet ter(info);
206 }
207
208 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val ue, const v8::FunctionCallbackInfo<v8::Value>& info) { 164 static void unrestrictedFloatAttributeAttributeSetter(v8::Local<v8::Value> v8Val ue, const v8::FunctionCallbackInfo<v8::Value>& info) {
209 v8::Local<v8::Object> holder = info.Holder(); 165 v8::Local<v8::Object> holder = info.Holder();
210 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 166 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
211 167
212 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "unrestrictedFloatAttribute"); 168 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "unrestrictedFloatAttribute");
213 169
214 // Prepare the value to be set. 170 // Prepare the value to be set.
215 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState); 171 float cppValue = toFloat(info.GetIsolate(), v8Value, exceptionState);
216 if (exceptionState.hadException()) 172 if (exceptionState.hadException())
217 return; 173 return;
218 174
219 impl->setUnrestrictedFloatAttribute(cppValue); 175 impl->setUnrestrictedFloatAttribute(cppValue);
220 } 176 }
221 177
222 MODULES_EXPORT void unrestrictedFloatAttributeAttributeSetterCallback(const v8:: FunctionCallbackInfo<v8::Value>& info) {
223 v8::Local<v8::Value> v8Value = info[0];
224
225 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSet ter(v8Value, info);
226 }
227
228 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo< v8::Value>& info) { 178 static void staticStringAttributeAttributeGetter(const v8::FunctionCallbackInfo< v8::Value>& info) {
229 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttribu te(), info.GetIsolate()); 179 v8SetReturnValueString(info, TestInterface5Implementation::staticStringAttribu te(), info.GetIsolate());
230 } 180 }
231 181
232 MODULES_EXPORT void staticStringAttributeAttributeGetterCallback(const v8::Funct ionCallbackInfo<v8::Value>& info) {
233 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(i nfo);
234 }
235
236 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c onst v8::FunctionCallbackInfo<v8::Value>& info) { 182 static void staticStringAttributeAttributeSetter(v8::Local<v8::Value> v8Value, c onst v8::FunctionCallbackInfo<v8::Value>& info) {
237 // Prepare the value to be set. 183 // Prepare the value to be set.
238 V8StringResource<> cppValue = v8Value; 184 V8StringResource<> cppValue = v8Value;
239 if (!cppValue.prepare()) 185 if (!cppValue.prepare())
240 return; 186 return;
241 187
242 TestInterface5Implementation::setStaticStringAttribute(cppValue); 188 TestInterface5Implementation::setStaticStringAttribute(cppValue);
243 } 189 }
244 190
245 MODULES_EXPORT void staticStringAttributeAttributeSetterCallback(const v8::Funct ionCallbackInfo<v8::Value>& info) {
246 v8::Local<v8::Value> v8Value = info[0];
247
248 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v 8Value, info);
249 }
250
251 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) { 191 static void alwaysExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) {
252 v8::Local<v8::Object> holder = info.Holder(); 192 v8::Local<v8::Object> holder = info.Holder();
253 193
254 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 194 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
255 195
256 v8SetReturnValueInt(info, impl->alwaysExposedAttribute()); 196 v8SetReturnValueInt(info, impl->alwaysExposedAttribute());
257 } 197 }
258 198
259 MODULES_EXPORT void alwaysExposedAttributeAttributeGetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
260 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter( info);
261 }
262
263 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) { 199 static void alwaysExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
264 v8::Local<v8::Object> holder = info.Holder(); 200 v8::Local<v8::Object> holder = info.Holder();
265 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 201 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
266 202
267 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "alwaysExposedAttribute"); 203 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "alwaysExposedAttribute");
268 204
269 // Prepare the value to be set. 205 // Prepare the value to be set.
270 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception State); 206 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception State);
271 if (exceptionState.hadException()) 207 if (exceptionState.hadException())
272 return; 208 return;
273 209
274 impl->setAlwaysExposedAttribute(cppValue); 210 impl->setAlwaysExposedAttribute(cppValue);
275 } 211 }
276 212
277 MODULES_EXPORT void alwaysExposedAttributeAttributeSetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
278 v8::Local<v8::Value> v8Value = info[0];
279
280 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter( v8Value, info);
281 }
282
283 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) { 213 static void workerExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) {
284 v8::Local<v8::Object> holder = info.Holder(); 214 v8::Local<v8::Object> holder = info.Holder();
285 215
286 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 216 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
287 217
288 v8SetReturnValueInt(info, impl->workerExposedAttribute()); 218 v8SetReturnValueInt(info, impl->workerExposedAttribute());
289 } 219 }
290 220
291 MODULES_EXPORT void workerExposedAttributeAttributeGetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
292 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter( info);
293 }
294
295 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) { 221 static void workerExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
296 v8::Local<v8::Object> holder = info.Holder(); 222 v8::Local<v8::Object> holder = info.Holder();
297 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 223 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
298 224
299 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "workerExposedAttribute"); 225 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "workerExposedAttribute");
300 226
301 // Prepare the value to be set. 227 // Prepare the value to be set.
302 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception State); 228 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception State);
303 if (exceptionState.hadException()) 229 if (exceptionState.hadException())
304 return; 230 return;
305 231
306 impl->setWorkerExposedAttribute(cppValue); 232 impl->setWorkerExposedAttribute(cppValue);
307 } 233 }
308 234
309 MODULES_EXPORT void workerExposedAttributeAttributeSetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
310 v8::Local<v8::Value> v8Value = info[0];
311
312 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter( v8Value, info);
313 }
314
315 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) { 235 static void windowExposedAttributeAttributeGetter(const v8::FunctionCallbackInfo <v8::Value>& info) {
316 v8::Local<v8::Object> holder = info.Holder(); 236 v8::Local<v8::Object> holder = info.Holder();
317 237
318 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 238 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
319 239
320 v8SetReturnValueInt(info, impl->windowExposedAttribute()); 240 v8SetReturnValueInt(info, impl->windowExposedAttribute());
321 } 241 }
322 242
323 MODULES_EXPORT void windowExposedAttributeAttributeGetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
324 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter( info);
325 }
326
327 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) { 243 static void windowExposedAttributeAttributeSetter(v8::Local<v8::Value> v8Value, const v8::FunctionCallbackInfo<v8::Value>& info) {
328 v8::Local<v8::Object> holder = info.Holder(); 244 v8::Local<v8::Object> holder = info.Holder();
329 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder); 245 TestInterface5Implementation* impl = V8TestInterface5::toImpl(holder);
330 246
331 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "windowExposedAttribute"); 247 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::SetterContext , "TestInterface5", "windowExposedAttribute");
332 248
333 // Prepare the value to be set. 249 // Prepare the value to be set.
334 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception State); 250 int cppValue = toInt32(info.GetIsolate(), v8Value, NormalConversion, exception State);
335 if (exceptionState.hadException()) 251 if (exceptionState.hadException())
336 return; 252 return;
337 253
338 impl->setWindowExposedAttribute(cppValue); 254 impl->setWindowExposedAttribute(cppValue);
339 } 255 }
340 256
341 MODULES_EXPORT void windowExposedAttributeAttributeSetterCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
342 v8::Local<v8::Value> v8Value = info[0];
343
344 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter( v8Value, info);
345 }
346
347 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) { 257 static void voidMethodTestInterfaceEmptyArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) {
348 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 258 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
349 259
350 if (UNLIKELY(info.Length() < 1)) { 260 if (UNLIKELY(info.Length() < 1)) {
351 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMessage s::notEnoughArguments(1, info.Length()))); 261 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", ExceptionMessage s::notEnoughArguments(1, info.Length())));
352 return; 262 return;
353 } 263 }
354 264
355 TestInterfaceEmpty* testInterfaceEmptyArg; 265 TestInterfaceEmpty* testInterfaceEmptyArg;
356 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsol ate(), info[0]); 266 testInterfaceEmptyArg = V8TestInterfaceEmpty::toImplWithTypeCheck(info.GetIsol ate(), info[0]);
357 if (!testInterfaceEmptyArg) { 267 if (!testInterfaceEmptyArg) {
358 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is not of type 'TestInterfaceEmpty'.")); 268 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodTestInterfaceEmptyArg", "TestInterface5", "parameter 1 is not of type 'TestInterfaceEmpty'."));
359 269
360 return; 270 return;
361 } 271 }
362 272
363 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg); 273 impl->voidMethodTestInterfaceEmptyArg(testInterfaceEmptyArg);
364 } 274 }
365 275
366 MODULES_EXPORT void voidMethodTestInterfaceEmptyArgMethodCallback(const v8::Fun ctionCallbackInfo<v8::Value>& info) {
367 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod( info);
368 }
369
370 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) { 276 static void voidMethodDoubleArgFloatArgMethod(const v8::FunctionCallbackInfo<v8: :Value>& info) {
371 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodDoubleArgFloatArg"); 277 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodDoubleArgFloatArg");
372 278
373 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 279 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
374 280
375 if (UNLIKELY(info.Length() < 2)) { 281 if (UNLIKELY(info.Length() < 2)) {
376 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info. Length())); 282 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info. Length()));
377 return; 283 return;
378 } 284 }
379 285
380 double doubleArg; 286 double doubleArg;
381 float floatArg; 287 float floatArg;
382 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState); 288 doubleArg = toRestrictedDouble(info.GetIsolate(), info[0], exceptionState);
383 if (exceptionState.hadException()) 289 if (exceptionState.hadException())
384 return; 290 return;
385 291
386 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState); 292 floatArg = toRestrictedFloat(info.GetIsolate(), info[1], exceptionState);
387 if (exceptionState.hadException()) 293 if (exceptionState.hadException())
388 return; 294 return;
389 295
390 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg); 296 impl->voidMethodDoubleArgFloatArg(doubleArg, floatArg);
391 } 297 }
392 298
393 MODULES_EXPORT void voidMethodDoubleArgFloatArgMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info) {
394 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info );
395 }
396
397 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info) { 299 static void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod(const v8:: FunctionCallbackInfo<v8::Value>& info) {
398 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg"); 300 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg");
399 301
400 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 302 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
401 303
402 if (UNLIKELY(info.Length() < 2)) { 304 if (UNLIKELY(info.Length() < 2)) {
403 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info. Length())); 305 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(2, info. Length()));
404 return; 306 return;
405 } 307 }
406 308
407 double unrestrictedDoubleArg; 309 double unrestrictedDoubleArg;
408 float unrestrictedFloatArg; 310 float unrestrictedFloatArg;
409 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState); 311 unrestrictedDoubleArg = toDouble(info.GetIsolate(), info[0], exceptionState);
410 if (exceptionState.hadException()) 312 if (exceptionState.hadException())
411 return; 313 return;
412 314
413 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState); 315 unrestrictedFloatArg = toFloat(info.GetIsolate(), info[1], exceptionState);
414 if (exceptionState.hadException()) 316 if (exceptionState.hadException())
415 return; 317 return;
416 318
417 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleAr g, unrestrictedFloatArg); 319 impl->voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg(unrestrictedDoubleAr g, unrestrictedFloatArg);
418 } 320 }
419 321
420 MODULES_EXPORT void voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCa llback(const v8::FunctionCallbackInfo<v8::Value>& info) {
421 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestr ictedFloatArgMethod(info);
422 }
423
424 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 322 static void voidMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
425 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 323 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
426 324
427 impl->voidMethod(); 325 impl->voidMethod();
428 } 326 }
429 327
430 MODULES_EXPORT void voidMethodMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) {
431 TestInterface5ImplementationV8Internal::voidMethodMethod(info);
432 }
433
434 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu e>& info) { 328 static void voidMethodMethodForMainWorld(const v8::FunctionCallbackInfo<v8::Valu e>& info) {
435 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 329 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
436 330
437 impl->voidMethod(); 331 impl->voidMethod();
438 } 332 }
439 333
440 MODULES_EXPORT void voidMethodMethodCallbackForMainWorld(const v8::FunctionCall backInfo<v8::Value>& info) {
441 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info);
442 }
443
444 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 334 static void alwaysExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
445 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 335 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
446 336
447 impl->alwaysExposedMethod(); 337 impl->alwaysExposedMethod();
448 } 338 }
449 339
450 MODULES_EXPORT void alwaysExposedMethodMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info) {
451 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info);
452 }
453
454 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 340 static void workerExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
455 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 341 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
456 342
457 impl->workerExposedMethod(); 343 impl->workerExposedMethod();
458 } 344 }
459 345
460 MODULES_EXPORT void workerExposedMethodMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info) {
461 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info);
462 }
463
464 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 346 static void windowExposedMethodMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
465 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 347 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
466 348
467 impl->windowExposedMethod(); 349 impl->windowExposedMethod();
468 } 350 }
469 351
470 MODULES_EXPORT void windowExposedMethodMethodCallback(const v8::FunctionCallbac kInfo<v8::Value>& info) {
471 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info);
472 }
473
474 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) { 352 static void alwaysExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) {
475 TestInterface5Implementation::alwaysExposedStaticMethod(); 353 TestInterface5Implementation::alwaysExposedStaticMethod();
476 } 354 }
477 355
478 MODULES_EXPORT void alwaysExposedStaticMethodMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) {
479 TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info);
480 }
481
482 static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) { 356 static void workerExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) {
483 TestInterface5Implementation::workerExposedStaticMethod(); 357 TestInterface5Implementation::workerExposedStaticMethod();
484 } 358 }
485 359
486 MODULES_EXPORT void workerExposedStaticMethodMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) {
487 TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info);
488 }
489
490 static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) { 360 static void windowExposedStaticMethodMethod(const v8::FunctionCallbackInfo<v8::V alue>& info) {
491 TestInterface5Implementation::windowExposedStaticMethod(); 361 TestInterface5Implementation::windowExposedStaticMethod();
492 } 362 }
493 363
494 MODULES_EXPORT void windowExposedStaticMethodMethodCallback(const v8::FunctionC allbackInfo<v8::Value>& info) {
495 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info);
496 }
497
498 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback Info<v8::Value>& info) { 364 static void windowAndServiceWorkerExposedMethodMethod(const v8::FunctionCallback Info<v8::Value>& info) {
499 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 365 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
500 366
501 impl->windowAndServiceWorkerExposedMethod(); 367 impl->windowAndServiceWorkerExposedMethod();
502 } 368 }
503 369
504 MODULES_EXPORT void windowAndServiceWorkerExposedMethodMethodCallback(const v8: :FunctionCallbackInfo<v8::Value>& info) {
505 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMet hod(info);
506 }
507
508 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) { 370 static void voidMethodBooleanOrDOMStringArgMethod(const v8::FunctionCallbackInfo <v8::Value>& info) {
509 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodBooleanOrDOMStringArg"); 371 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodBooleanOrDOMStringArg");
510 372
511 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 373 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
512 374
513 if (UNLIKELY(info.Length() < 1)) { 375 if (UNLIKELY(info.Length() < 1)) {
514 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info. Length())); 376 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info. Length()));
515 return; 377 return;
516 } 378 }
517 379
518 BooleanOrString arg; 380 BooleanOrString arg;
519 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversion Mode::NotNullable, exceptionState); 381 V8BooleanOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversion Mode::NotNullable, exceptionState);
520 if (exceptionState.hadException()) 382 if (exceptionState.hadException())
521 return; 383 return;
522 384
523 impl->voidMethodBooleanOrDOMStringArg(arg); 385 impl->voidMethodBooleanOrDOMStringArg(arg);
524 } 386 }
525 387
526 MODULES_EXPORT void voidMethodBooleanOrDOMStringArgMethodCallback(const v8::Fun ctionCallbackInfo<v8::Value>& info) {
527 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMethod( info);
528 }
529
530 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo< v8::Value>& info) { 388 static void voidMethodDoubleOrDOMStringArgMethod(const v8::FunctionCallbackInfo< v8::Value>& info) {
531 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodDoubleOrDOMStringArg"); 389 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "voidMethodDoubleOrDOMStringArg");
532 390
533 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 391 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
534 392
535 if (UNLIKELY(info.Length() < 1)) { 393 if (UNLIKELY(info.Length() < 1)) {
536 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info. Length())); 394 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info. Length()));
537 return; 395 return;
538 } 396 }
539 397
540 DoubleOrString arg; 398 DoubleOrString arg;
541 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionM ode::NotNullable, exceptionState); 399 V8DoubleOrString::toImpl(info.GetIsolate(), info[0], arg, UnionTypeConversionM ode::NotNullable, exceptionState);
542 if (exceptionState.hadException()) 400 if (exceptionState.hadException())
543 return; 401 return;
544 402
545 impl->voidMethodDoubleOrDOMStringArg(arg); 403 impl->voidMethodDoubleOrDOMStringArg(arg);
546 } 404 }
547 405
548 MODULES_EXPORT void voidMethodDoubleOrDOMStringArgMethodCallback(const v8::Func tionCallbackInfo<v8::Value>& info) {
549 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod(i nfo);
550 }
551
552 static void voidMethodVoidExperimentalCallbackFunctionMethod(const v8::FunctionC allbackInfo<v8::Value>& info) { 406 static void voidMethodVoidExperimentalCallbackFunctionMethod(const v8::FunctionC allbackInfo<v8::Value>& info) {
553 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 407 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
554 408
555 if (UNLIKELY(info.Length() < 1)) { 409 if (UNLIKELY(info.Length() < 1)) {
556 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", Excep tionMessages::notEnoughArguments(1, info.Length()))); 410 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", Excep tionMessages::notEnoughArguments(1, info.Length())));
557 return; 411 return;
558 } 412 }
559 413
560 VoidExperimentalCallbackFunction* arg; 414 VoidExperimentalCallbackFunction* arg;
561 arg = V8VoidExperimentalCallbackFunction::toImplWithTypeCheck(info.GetIsolate( ), info[0]); 415 arg = V8VoidExperimentalCallbackFunction::toImplWithTypeCheck(info.GetIsolate( ), info[0]);
562 if (!arg) { 416 if (!arg) {
563 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", "para meter 1 is not of type 'VoidExperimentalCallbackFunction'.")); 417 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidExperimentalCallbackFunction", "TestInterface5", "para meter 1 is not of type 'VoidExperimentalCallbackFunction'."));
564 418
565 return; 419 return;
566 } 420 }
567 421
568 impl->voidMethodVoidExperimentalCallbackFunction(arg); 422 impl->voidMethodVoidExperimentalCallbackFunction(arg);
569 } 423 }
570 424
571 MODULES_EXPORT void voidMethodVoidExperimentalCallbackFunctionMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info) {
572 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunc tionMethod(info);
573 }
574
575 static void voidMethodVoidCallbackFunctionModulesArgMethod(const v8::FunctionCal lbackInfo<v8::Value>& info) { 425 static void voidMethodVoidCallbackFunctionModulesArgMethod(const v8::FunctionCal lbackInfo<v8::Value>& info) {
576 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 426 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
577 427
578 if (UNLIKELY(info.Length() < 1)) { 428 if (UNLIKELY(info.Length() < 1)) {
579 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", Excepti onMessages::notEnoughArguments(1, info.Length()))); 429 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", Excepti onMessages::notEnoughArguments(1, info.Length())));
580 return; 430 return;
581 } 431 }
582 432
583 VoidCallbackFunctionModules* arg; 433 VoidCallbackFunctionModules* arg;
584 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable( ))) { 434 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable( ))) {
585 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The ca llback provided as parameter 1 is not a function.")); 435 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::faile dToExecute("voidMethodVoidCallbackFunctionModulesArg", "TestInterface5", "The ca llback provided as parameter 1 is not a function."));
586 436
587 return; 437 return;
588 } 438 }
589 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsolate ()), info[0]); 439 arg = VoidCallbackFunctionModules::create(ScriptState::current(info.GetIsolate ()), info[0]);
590 440
591 impl->voidMethodVoidCallbackFunctionModulesArg(arg); 441 impl->voidMethodVoidCallbackFunctionModulesArg(arg);
592 } 442 }
593 443
594 MODULES_EXPORT void voidMethodVoidCallbackFunctionModulesArgMethodCallback(cons t v8::FunctionCallbackInfo<v8::Value>& info) {
595 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesA rgMethod(info);
596 }
597
598 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 444 static void keysMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
599 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "keys"); 445 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "keys");
600 446
601 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 447 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
602 448
603 ScriptState* scriptState = ScriptState::forReceiverObject(info); 449 ScriptState* scriptState = ScriptState::forReceiverObject(info);
604 450
605 Iterator* result = impl->keysForBinding(scriptState, exceptionState); 451 Iterator* result = impl->keysForBinding(scriptState, exceptionState);
606 if (exceptionState.hadException()) { 452 if (exceptionState.hadException()) {
607 return; 453 return;
608 } 454 }
609 v8SetReturnValue(info, result); 455 v8SetReturnValue(info, result);
610 } 456 }
611 457
612 MODULES_EXPORT void keysMethodCallback(const v8::FunctionCallbackInfo<v8::Value >& info) {
613 TestInterface5ImplementationV8Internal::keysMethod(info);
614 }
615
616 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 458 static void valuesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
617 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "values"); 459 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "values");
618 460
619 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 461 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
620 462
621 ScriptState* scriptState = ScriptState::forReceiverObject(info); 463 ScriptState* scriptState = ScriptState::forReceiverObject(info);
622 464
623 Iterator* result = impl->valuesForBinding(scriptState, exceptionState); 465 Iterator* result = impl->valuesForBinding(scriptState, exceptionState);
624 if (exceptionState.hadException()) { 466 if (exceptionState.hadException()) {
625 return; 467 return;
626 } 468 }
627 v8SetReturnValue(info, result); 469 v8SetReturnValue(info, result);
628 } 470 }
629 471
630 MODULES_EXPORT void valuesMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) {
631 TestInterface5ImplementationV8Internal::valuesMethod(info);
632 }
633
634 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 472 static void entriesMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
635 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "entries"); 473 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "entries");
636 474
637 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 475 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
638 476
639 ScriptState* scriptState = ScriptState::forReceiverObject(info); 477 ScriptState* scriptState = ScriptState::forReceiverObject(info);
640 478
641 Iterator* result = impl->entriesForBinding(scriptState, exceptionState); 479 Iterator* result = impl->entriesForBinding(scriptState, exceptionState);
642 if (exceptionState.hadException()) { 480 if (exceptionState.hadException()) {
643 return; 481 return;
644 } 482 }
645 v8SetReturnValue(info, result); 483 v8SetReturnValue(info, result);
646 } 484 }
647 485
648 MODULES_EXPORT void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) {
649 TestInterface5ImplementationV8Internal::entriesMethod(info);
650 }
651
652 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 486 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
653 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "forEach"); 487 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "forEach");
654 488
655 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 489 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
656 490
657 ScriptState* scriptState = ScriptState::forReceiverObject(info); 491 ScriptState* scriptState = ScriptState::forReceiverObject(info);
658 492
659 if (UNLIKELY(info.Length() < 1)) { 493 if (UNLIKELY(info.Length() < 1)) {
660 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info. Length())); 494 exceptionState.throwTypeError(ExceptionMessages::notEnoughArguments(1, info. Length()));
661 return; 495 return;
662 } 496 }
663 497
664 ScriptValue callback; 498 ScriptValue callback;
665 ScriptValue thisArg; 499 ScriptValue thisArg;
666 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable( ))) { 500 if (!(info[0]->IsObject() && v8::Local<v8::Object>::Cast(info[0])->IsCallable( ))) {
667 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function."); 501 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
668 502
669 return; 503 return;
670 } 504 }
671 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]); 505 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]);
672 506
673 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]); 507 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
674 508
675 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()), callback, thisArg, exceptionState); 509 impl->forEachForBinding(scriptState, ScriptValue(scriptState, info.Holder()), callback, thisArg, exceptionState);
676 if (exceptionState.hadException()) { 510 if (exceptionState.hadException()) {
677 return; 511 return;
678 } 512 }
679 } 513 }
680 514
681 MODULES_EXPORT void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) {
682 TestInterface5ImplementationV8Internal::forEachMethod(info);
683 }
684
685 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 515 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
686 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 516 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
687 517
688 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); 518 v8SetReturnValueString(info, impl->toString(), info.GetIsolate());
689 } 519 }
690 520
691 MODULES_EXPORT void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) {
692 TestInterface5ImplementationV8Internal::toStringMethod(info);
693 }
694
695 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) { 521 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) {
696 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "iterator"); 522 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::ExecutionCont ext, "TestInterface5", "iterator");
697 523
698 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 524 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
699 525
700 ScriptState* scriptState = ScriptState::forReceiverObject(info); 526 ScriptState* scriptState = ScriptState::forReceiverObject(info);
701 527
702 Iterator* result = impl->iterator(scriptState, exceptionState); 528 Iterator* result = impl->iterator(scriptState, exceptionState);
703 if (exceptionState.hadException()) { 529 if (exceptionState.hadException()) {
704 return; 530 return;
705 } 531 }
706 v8SetReturnValue(info, result); 532 v8SetReturnValue(info, result);
707 } 533 }
708 534
709 MODULES_EXPORT void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) {
710 TestInterface5ImplementationV8Internal::iteratorMethod(info);
711 }
712
713 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall backInfo<v8::Value>& info) { 535 static void namedPropertyGetter(const AtomicString& name, const v8::PropertyCall backInfo<v8::Value>& info) {
714 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 536 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
715 String result = impl->anonymousNamedGetter(name); 537 String result = impl->anonymousNamedGetter(name);
716 if (result.isNull()) 538 if (result.isNull())
717 return; 539 return;
718 v8SetReturnValueString(info, result, info.GetIsolate()); 540 v8SetReturnValueString(info, result, info.GetIsolate());
719 } 541 }
720 542
721 MODULES_EXPORT void namedPropertyGetterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Value>& info) {
722 if (!name->IsString())
723 return;
724 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
725
726 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, info );
727 }
728
729 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { 543 static void namedPropertySetter(const AtomicString& name, v8::Local<v8::Value> v 8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
730 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 544 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
731 V8StringResource<> propertyValue = v8Value; 545 V8StringResource<> propertyValue = v8Value;
732 if (!propertyValue.prepare()) 546 if (!propertyValue.prepare())
733 return; 547 return;
734 548
735 bool result = impl->anonymousNamedSetter(name, propertyValue); 549 bool result = impl->anonymousNamedSetter(name, propertyValue);
736 if (!result) 550 if (!result)
737 return; 551 return;
738 v8SetReturnValue(info, v8Value); 552 v8SetReturnValue(info, v8Value);
739 } 553 }
740 554
741 MODULES_EXPORT void namedPropertySetterCallback(v8::Local<v8::Name> name, v8::Lo cal<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
742 if (!name->IsString())
743 return;
744 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
745
746 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8Va lue, info);
747 }
748
749 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal lbackInfo<v8::Boolean>& info) { 555 static void namedPropertyDeleter(const AtomicString& name, const v8::PropertyCal lbackInfo<v8::Boolean>& info) {
750 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 556 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
751 557
752 DeleteResult result = impl->anonymousNamedDeleter(name); 558 DeleteResult result = impl->anonymousNamedDeleter(name);
753 if (result == DeleteUnknownProperty) 559 if (result == DeleteUnknownProperty)
754 return; 560 return;
755 v8SetReturnValue(info, result == DeleteSuccess); 561 v8SetReturnValue(info, result == DeleteSuccess);
756 } 562 }
757 563
758 MODULES_EXPORT void namedPropertyDeleterCallback(v8::Local<v8::Name> name, const v8::PropertyCallbackInfo<v8::Boolean>& info) {
759 if (!name->IsString())
760 return;
761 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
762
763 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, inf o);
764 }
765
766 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb ackInfo<v8::Integer>& info) { 564 static void namedPropertyQuery(const AtomicString& name, const v8::PropertyCallb ackInfo<v8::Integer>& info) {
767 const CString& nameInUtf8 = name.utf8(); 565 const CString& nameInUtf8 = name.utf8();
768 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext , "TestInterface5", nameInUtf8.data()); 566 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::GetterContext , "TestInterface5", nameInUtf8.data());
769 567
770 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 568 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
771 569
772 bool result = impl->namedPropertyQuery(name, exceptionState); 570 bool result = impl->namedPropertyQuery(name, exceptionState);
773 if (!result) 571 if (!result)
774 return; 572 return;
775 v8SetReturnValueInt(info, v8::None); 573 v8SetReturnValueInt(info, v8::None);
776 } 574 }
777 575
778 MODULES_EXPORT void namedPropertyQueryCallback(v8::Local<v8::Name> name, const v 8::PropertyCallbackInfo<v8::Integer>& info) {
779 if (!name->IsString())
780 return;
781 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
782
783 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, info) ;
784 }
785
786 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) { 576 static void namedPropertyEnumerator(const v8::PropertyCallbackInfo<v8::Array>& i nfo) {
787 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationCo ntext, "TestInterface5"); 577 ExceptionState exceptionState(info.GetIsolate(), ExceptionState::EnumerationCo ntext, "TestInterface5");
788 578
789 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 579 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
790 580
791 Vector<String> names; 581 Vector<String> names;
792 impl->namedPropertyEnumerator(names, exceptionState); 582 impl->namedPropertyEnumerator(names, exceptionState);
793 if (exceptionState.hadException()) 583 if (exceptionState.hadException())
794 return; 584 return;
795 v8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Ar ray>()); 585 v8SetReturnValue(info, ToV8(names, info.Holder(), info.GetIsolate()).As<v8::Ar ray>());
796 } 586 }
797 587
798 MODULES_EXPORT void namedPropertyEnumeratorCallback(const v8::PropertyCallbackIn fo<v8::Array>& info) {
799 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info);
800 }
801
802 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) { 588 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) {
803 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 589 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
804 590
805 // We assume that all the implementations support length() method, although 591 // We assume that all the implementations support length() method, although
806 // the spec doesn't require that length() must exist. It's okay that 592 // the spec doesn't require that length() must exist. It's okay that
807 // the interface does not have length attribute as long as the 593 // the interface does not have length attribute as long as the
808 // implementation supports length() member function. 594 // implementation supports length() member function.
809 if (index >= impl->length()) 595 if (index >= impl->length())
810 return; // Returns undefined due to out-of-range. 596 return; // Returns undefined due to out-of-range.
811 597
812 String result = impl->anonymousIndexedGetter(index); 598 String result = impl->anonymousIndexedGetter(index);
813 v8SetReturnValueString(info, result, info.GetIsolate()); 599 v8SetReturnValueString(info, result, info.GetIsolate());
814 } 600 }
815 601
816 MODULES_EXPORT void indexedPropertyGetterCallback(uint32_t index, const v8::Prop ertyCallbackInfo<v8::Value>& info) {
817 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info);
818 }
819
820 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) { 602 static void indexedPropertySetter(uint32_t index, v8::Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
821 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 603 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
822 V8StringResource<> propertyValue = v8Value; 604 V8StringResource<> propertyValue = v8Value;
823 if (!propertyValue.prepare()) 605 if (!propertyValue.prepare())
824 return; 606 return;
825 607
826 bool result = impl->anonymousIndexedSetter(index, propertyValue); 608 bool result = impl->anonymousIndexedSetter(index, propertyValue);
827 if (!result) 609 if (!result)
828 return; 610 return;
829 v8SetReturnValue(info, v8Value); 611 v8SetReturnValue(info, v8Value);
830 } 612 }
831 613
832 MODULES_EXPORT void indexedPropertySetterCallback(uint32_t index, v8::Local<v8:: Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
833 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value, info);
834 }
835
836 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf o<v8::Boolean>& info) { 614 static void indexedPropertyDeleter(uint32_t index, const v8::PropertyCallbackInf o<v8::Boolean>& info) {
837 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder()); 615 TestInterface5Implementation* impl = V8TestInterface5::toImpl(info.Holder());
838 616
839 DeleteResult result = impl->anonymousIndexedDeleter(index); 617 DeleteResult result = impl->anonymousIndexedDeleter(index);
840 if (result == DeleteUnknownProperty) 618 if (result == DeleteUnknownProperty)
841 return; 619 return;
842 v8SetReturnValue(info, result == DeleteSuccess); 620 v8SetReturnValue(info, result == DeleteSuccess);
843 } 621 }
844 622
845 MODULES_EXPORT void indexedPropertyDeleterCallback(uint32_t index, const v8::Pro pertyCallbackInfo<v8::Boolean>& info) { 623 } // namespace TestInterface5ImplementationV8Internal
624
625 void V8TestInterface5::testInterfaceAttributeAttributeGetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
626 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeGetter( info);
627 }
628
629 void V8TestInterface5::testInterfaceAttributeAttributeSetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
630 v8::Local<v8::Value> v8Value = info[0];
631
632 TestInterface5ImplementationV8Internal::testInterfaceAttributeAttributeSetter( v8Value, info);
633 }
634
635 void V8TestInterface5::doubleAttributeAttributeGetterCallback(const v8::Function CallbackInfo<v8::Value>& info) {
636 TestInterface5ImplementationV8Internal::doubleAttributeAttributeGetter(info);
637 }
638
639 void V8TestInterface5::doubleAttributeAttributeSetterCallback(const v8::Function CallbackInfo<v8::Value>& info) {
640 v8::Local<v8::Value> v8Value = info[0];
641
642 TestInterface5ImplementationV8Internal::doubleAttributeAttributeSetter(v8Value , info);
643 }
644
645 void V8TestInterface5::floatAttributeAttributeGetterCallback(const v8::FunctionC allbackInfo<v8::Value>& info) {
646 TestInterface5ImplementationV8Internal::floatAttributeAttributeGetter(info);
647 }
648
649 void V8TestInterface5::floatAttributeAttributeSetterCallback(const v8::FunctionC allbackInfo<v8::Value>& info) {
650 v8::Local<v8::Value> v8Value = info[0];
651
652 TestInterface5ImplementationV8Internal::floatAttributeAttributeSetter(v8Value, info);
653 }
654
655 void V8TestInterface5::unrestrictedDoubleAttributeAttributeGetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
656 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeGe tter(info);
657 }
658
659 void V8TestInterface5::unrestrictedDoubleAttributeAttributeSetterCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
660 v8::Local<v8::Value> v8Value = info[0];
661
662 TestInterface5ImplementationV8Internal::unrestrictedDoubleAttributeAttributeSe tter(v8Value, info);
663 }
664
665 void V8TestInterface5::unrestrictedFloatAttributeAttributeGetterCallback(const v 8::FunctionCallbackInfo<v8::Value>& info) {
666 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeGet ter(info);
667 }
668
669 void V8TestInterface5::unrestrictedFloatAttributeAttributeSetterCallback(const v 8::FunctionCallbackInfo<v8::Value>& info) {
670 v8::Local<v8::Value> v8Value = info[0];
671
672 TestInterface5ImplementationV8Internal::unrestrictedFloatAttributeAttributeSet ter(v8Value, info);
673 }
674
675 void V8TestInterface5::staticStringAttributeAttributeGetterCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info) {
676 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeGetter(i nfo);
677 }
678
679 void V8TestInterface5::staticStringAttributeAttributeSetterCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info) {
680 v8::Local<v8::Value> v8Value = info[0];
681
682 TestInterface5ImplementationV8Internal::staticStringAttributeAttributeSetter(v 8Value, info);
683 }
684
685 void V8TestInterface5::alwaysExposedAttributeAttributeGetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
686 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeGetter( info);
687 }
688
689 void V8TestInterface5::alwaysExposedAttributeAttributeSetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
690 v8::Local<v8::Value> v8Value = info[0];
691
692 TestInterface5ImplementationV8Internal::alwaysExposedAttributeAttributeSetter( v8Value, info);
693 }
694
695 void V8TestInterface5::workerExposedAttributeAttributeGetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
696 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeGetter( info);
697 }
698
699 void V8TestInterface5::workerExposedAttributeAttributeSetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
700 v8::Local<v8::Value> v8Value = info[0];
701
702 TestInterface5ImplementationV8Internal::workerExposedAttributeAttributeSetter( v8Value, info);
703 }
704
705 void V8TestInterface5::windowExposedAttributeAttributeGetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
706 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeGetter( info);
707 }
708
709 void V8TestInterface5::windowExposedAttributeAttributeSetterCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
710 v8::Local<v8::Value> v8Value = info[0];
711
712 TestInterface5ImplementationV8Internal::windowExposedAttributeAttributeSetter( v8Value, info);
713 }
714
715 void V8TestInterface5::voidMethodTestInterfaceEmptyArgMethodCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
716 TestInterface5ImplementationV8Internal::voidMethodTestInterfaceEmptyArgMethod( info);
717 }
718
719 void V8TestInterface5::voidMethodDoubleArgFloatArgMethodCallback(const v8::Funct ionCallbackInfo<v8::Value>& info) {
720 TestInterface5ImplementationV8Internal::voidMethodDoubleArgFloatArgMethod(info );
721 }
722
723 void V8TestInterface5::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethod Callback(const v8::FunctionCallbackInfo<v8::Value>& info) {
724 TestInterface5ImplementationV8Internal::voidMethodUnrestrictedDoubleArgUnrestr ictedFloatArgMethod(info);
725 }
726
727 void V8TestInterface5::voidMethodMethodCallback(const v8::FunctionCallbackInfo<v 8::Value>& info) {
728 TestInterface5ImplementationV8Internal::voidMethodMethod(info);
729 }
730
731 void V8TestInterface5::voidMethodMethodCallbackForMainWorld(const v8::FunctionCa llbackInfo<v8::Value>& info) {
732 TestInterface5ImplementationV8Internal::voidMethodMethodForMainWorld(info);
733 }
734
735 void V8TestInterface5::alwaysExposedMethodMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) {
736 TestInterface5ImplementationV8Internal::alwaysExposedMethodMethod(info);
737 }
738
739 void V8TestInterface5::workerExposedMethodMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) {
740 TestInterface5ImplementationV8Internal::workerExposedMethodMethod(info);
741 }
742
743 void V8TestInterface5::windowExposedMethodMethodCallback(const v8::FunctionCallb ackInfo<v8::Value>& info) {
744 TestInterface5ImplementationV8Internal::windowExposedMethodMethod(info);
745 }
746
747 void V8TestInterface5::alwaysExposedStaticMethodMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info) {
748 TestInterface5ImplementationV8Internal::alwaysExposedStaticMethodMethod(info);
749 }
750
751 void V8TestInterface5::workerExposedStaticMethodMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info) {
752 TestInterface5ImplementationV8Internal::workerExposedStaticMethodMethod(info);
753 }
754
755 void V8TestInterface5::windowExposedStaticMethodMethodCallback(const v8::Functio nCallbackInfo<v8::Value>& info) {
756 TestInterface5ImplementationV8Internal::windowExposedStaticMethodMethod(info);
757 }
758
759 void V8TestInterface5::windowAndServiceWorkerExposedMethodMethodCallback(const v 8::FunctionCallbackInfo<v8::Value>& info) {
760 TestInterface5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMet hod(info);
761 }
762
763 void V8TestInterface5::voidMethodBooleanOrDOMStringArgMethodCallback(const v8::F unctionCallbackInfo<v8::Value>& info) {
764 TestInterface5ImplementationV8Internal::voidMethodBooleanOrDOMStringArgMethod( info);
765 }
766
767 void V8TestInterface5::voidMethodDoubleOrDOMStringArgMethodCallback(const v8::Fu nctionCallbackInfo<v8::Value>& info) {
768 TestInterface5ImplementationV8Internal::voidMethodDoubleOrDOMStringArgMethod(i nfo);
769 }
770
771 void V8TestInterface5::voidMethodVoidExperimentalCallbackFunctionMethodCallback( const v8::FunctionCallbackInfo<v8::Value>& info) {
772 TestInterface5ImplementationV8Internal::voidMethodVoidExperimentalCallbackFunc tionMethod(info);
773 }
774
775 void V8TestInterface5::voidMethodVoidCallbackFunctionModulesArgMethodCallback(co nst v8::FunctionCallbackInfo<v8::Value>& info) {
776 TestInterface5ImplementationV8Internal::voidMethodVoidCallbackFunctionModulesA rgMethod(info);
777 }
778
779 void V8TestInterface5::keysMethodCallback(const v8::FunctionCallbackInfo<v8::Val ue>& info) {
780 TestInterface5ImplementationV8Internal::keysMethod(info);
781 }
782
783 void V8TestInterface5::valuesMethodCallback(const v8::FunctionCallbackInfo<v8::V alue>& info) {
784 TestInterface5ImplementationV8Internal::valuesMethod(info);
785 }
786
787 void V8TestInterface5::entriesMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) {
788 TestInterface5ImplementationV8Internal::entriesMethod(info);
789 }
790
791 void V8TestInterface5::forEachMethodCallback(const v8::FunctionCallbackInfo<v8:: Value>& info) {
792 TestInterface5ImplementationV8Internal::forEachMethod(info);
793 }
794
795 void V8TestInterface5::toStringMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) {
796 TestInterface5ImplementationV8Internal::toStringMethod(info);
797 }
798
799 void V8TestInterface5::iteratorMethodCallback(const v8::FunctionCallbackInfo<v8: :Value>& info) {
800 TestInterface5ImplementationV8Internal::iteratorMethod(info);
801 }
802
803 void V8TestInterface5::namedPropertyGetterCallback(v8::Local<v8::Name> name, con st v8::PropertyCallbackInfo<v8::Value>& info) {
804 if (!name->IsString())
805 return;
806 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
807
808 TestInterface5ImplementationV8Internal::namedPropertyGetter(propertyName, info );
809 }
810
811 void V8TestInterface5::namedPropertySetterCallback(v8::Local<v8::Name> name, v8: :Local<v8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
812 if (!name->IsString())
813 return;
814 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
815
816 TestInterface5ImplementationV8Internal::namedPropertySetter(propertyName, v8Va lue, info);
817 }
818
819 void V8TestInterface5::namedPropertyDeleterCallback(v8::Local<v8::Name> name, co nst v8::PropertyCallbackInfo<v8::Boolean>& info) {
820 if (!name->IsString())
821 return;
822 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
823
824 TestInterface5ImplementationV8Internal::namedPropertyDeleter(propertyName, inf o);
825 }
826
827 void V8TestInterface5::namedPropertyQueryCallback(v8::Local<v8::Name> name, cons t v8::PropertyCallbackInfo<v8::Integer>& info) {
828 if (!name->IsString())
829 return;
830 const AtomicString& propertyName = toCoreAtomicString(name.As<v8::String>());
831
832 TestInterface5ImplementationV8Internal::namedPropertyQuery(propertyName, info) ;
833 }
834
835 void V8TestInterface5::namedPropertyEnumeratorCallback(const v8::PropertyCallbac kInfo<v8::Array>& info) {
836 TestInterface5ImplementationV8Internal::namedPropertyEnumerator(info);
837 }
838
839 void V8TestInterface5::indexedPropertyGetterCallback(uint32_t index, const v8::P ropertyCallbackInfo<v8::Value>& info) {
840 TestInterface5ImplementationV8Internal::indexedPropertyGetter(index, info);
841 }
842
843 void V8TestInterface5::indexedPropertySetterCallback(uint32_t index, v8::Local<v 8::Value> v8Value, const v8::PropertyCallbackInfo<v8::Value>& info) {
844 TestInterface5ImplementationV8Internal::indexedPropertySetter(index, v8Value, info);
845 }
846
847 void V8TestInterface5::indexedPropertyDeleterCallback(uint32_t index, const v8:: PropertyCallbackInfo<v8::Boolean>& info) {
846 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info); 848 TestInterface5ImplementationV8Internal::indexedPropertyDeleter(index, info);
847 } 849 }
848 850
849 } // namespace TestInterface5ImplementationV8Internal
850
851 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc riptWrappable, const v8::Persistent<v8::Object>& wrapper) { 851 void V8TestInterface5::visitDOMWrapper(v8::Isolate* isolate, ScriptWrappable* sc riptWrappable, const v8::Persistent<v8::Object>& wrapper) {
852 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5Imp lementation>(); 852 TestInterface5Implementation* impl = scriptWrappable->toImpl<TestInterface5Imp lementation>();
853 TestInterface5Implementation* referencedName = impl->referencedName(); 853 TestInterface5Implementation* referencedName = impl->referencedName();
854 if (referencedName) { 854 if (referencedName) {
855 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName, is olate); 855 DOMWrapperWorld::setWrapperReferencesInAllWorlds(wrapper, referencedName, is olate);
856 } 856 }
857 } 857 }
858 858
859 // Suppress warning: global constructors, because AttributeConfiguration is triv ial 859 // Suppress warning: global constructors, because AttributeConfiguration is triv ial
860 // and does not depend on another global objects. 860 // and does not depend on another global objects.
861 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 861 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
862 #pragma clang diagnostic push 862 #pragma clang diagnostic push
863 #pragma clang diagnostic ignored "-Wglobal-constructors" 863 #pragma clang diagnostic ignored "-Wglobal-constructors"
864 #endif 864 #endif
865 const V8DOMConfiguration::AttributeConfiguration V8TestInterface5LazyDataAttribu tes[] = { 865 const V8DOMConfiguration::AttributeConfiguration V8TestInterface5LazyDataAttribu tes[] = {
866 {"testInterfaceConstructorAttribute", v8ConstructorAttributeGetter, 0, 0, 0, nullptr, const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrapperTypeInfo), stat ic_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::OnInstance, V8 DOMConfiguration::CheckHolder}, 866 {"testInterfaceConstructorAttribute", v8ConstructorAttributeGetter, nullptr, nullptr, nullptr, nullptr, const_cast<WrapperTypeInfo*>(&V8TestInterface5::wrap perTypeInfo), static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfigurati on::OnInstance, V8DOMConfiguration::CheckHolder},
867 }; 867 };
868 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG) 868 #if defined(COMPONENT_BUILD) && defined(WIN32) && COMPILER(CLANG)
869 #pragma clang diagnostic pop 869 #pragma clang diagnostic pop
870 #endif 870 #endif
871 871
872 const V8DOMConfiguration::AccessorConfiguration V8TestInterface5Accessors[] = { 872 const V8DOMConfiguration::AccessorConfiguration V8TestInterface5Accessors[] = {
873 {"testInterfaceAttribute", TestInterface5ImplementationV8Internal::testInter faceAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::te stInterfaceAttributeAttributeSetterCallback, 0, 0, nullptr, 0, static_cast<v8::P ropertyAttribute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration ::CheckHolder}, 873 {"testInterfaceAttribute", V8TestInterface5::testInterfaceAttributeAttribute GetterCallback, V8TestInterface5::testInterfaceAttributeAttributeSetterCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None ), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
874 {"doubleAttribute", TestInterface5ImplementationV8Internal::doubleAttributeA ttributeGetterCallback, TestInterface5ImplementationV8Internal::doubleAttributeA ttributeSetterCallback, 0, 0, nullptr, 0, static_cast<v8::PropertyAttribute>(v8: :None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 874 {"doubleAttribute", V8TestInterface5::doubleAttributeAttributeGetterCallback , V8TestInterface5::doubleAttributeAttributeSetterCallback, nullptr, nullptr, nu llptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration ::OnPrototype, V8DOMConfiguration::CheckHolder},
875 {"floatAttribute", TestInterface5ImplementationV8Internal::floatAttributeAtt ributeGetterCallback, TestInterface5ImplementationV8Internal::floatAttributeAttr ibuteSetterCallback, 0, 0, nullptr, 0, static_cast<v8::PropertyAttribute>(v8::No ne), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 875 {"floatAttribute", V8TestInterface5::floatAttributeAttributeGetterCallback, V8TestInterface5::floatAttributeAttributeSetterCallback, nullptr, nullptr, nullp tr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::O nPrototype, V8DOMConfiguration::CheckHolder},
876 {"unrestrictedDoubleAttribute", TestInterface5ImplementationV8Internal::unre strictedDoubleAttributeAttributeGetterCallback, TestInterface5ImplementationV8In ternal::unrestrictedDoubleAttributeAttributeSetterCallback, 0, 0, nullptr, 0, st atic_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::OnPrototype, V8D OMConfiguration::CheckHolder}, 876 {"unrestrictedDoubleAttribute", V8TestInterface5::unrestrictedDoubleAttribut eAttributeGetterCallback, V8TestInterface5::unrestrictedDoubleAttributeAttribute SetterCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttr ibute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHold er},
877 {"unrestrictedFloatAttribute", TestInterface5ImplementationV8Internal::unres trictedFloatAttributeAttributeGetterCallback, TestInterface5ImplementationV8Inte rnal::unrestrictedFloatAttributeAttributeSetterCallback, 0, 0, nullptr, 0, stati c_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMC onfiguration::CheckHolder}, 877 {"unrestrictedFloatAttribute", V8TestInterface5::unrestrictedFloatAttributeA ttributeGetterCallback, V8TestInterface5::unrestrictedFloatAttributeAttributeSet terCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribu te>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder} ,
878 {"staticStringAttribute", TestInterface5ImplementationV8Internal::staticStri ngAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::stat icStringAttributeAttributeSetterCallback, 0, 0, nullptr, 0, static_cast<v8::Prop ertyAttribute>(v8::None), V8DOMConfiguration::OnInterface, V8DOMConfiguration::C heckHolder}, 878 {"staticStringAttribute", V8TestInterface5::staticStringAttributeAttributeGe tterCallback, V8TestInterface5::staticStringAttributeAttributeSetterCallback, nu llptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOMConfiguration::OnInterface, V8DOMConfiguration::CheckHolder},
879 {"alwaysExposedAttribute", TestInterface5ImplementationV8Internal::alwaysExp osedAttributeAttributeGetterCallback, TestInterface5ImplementationV8Internal::al waysExposedAttributeAttributeSetterCallback, 0, 0, nullptr, 0, static_cast<v8::P ropertyAttribute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration ::CheckHolder}, 879 {"alwaysExposedAttribute", V8TestInterface5::alwaysExposedAttributeAttribute GetterCallback, V8TestInterface5::alwaysExposedAttributeAttributeSetterCallback, nullptr, nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None ), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
880 }; 880 };
881 881
882 const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = { 882 const V8DOMConfiguration::MethodConfiguration V8TestInterface5Methods[] = {
883 {"voidMethodTestInterfaceEmptyArg", TestInterface5ImplementationV8Internal:: voidMethodTestInterfaceEmptyArgMethodCallback, 0, 1, v8::None, V8DOMConfiguratio n::OnPrototype, V8DOMConfiguration::CheckHolder}, 883 {"voidMethodTestInterfaceEmptyArg", V8TestInterface5::voidMethodTestInterfac eEmptyArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
884 {"voidMethodDoubleArgFloatArg", TestInterface5ImplementationV8Internal::void MethodDoubleArgFloatArgMethodCallback, 0, 2, v8::None, V8DOMConfiguration::OnPro totype, V8DOMConfiguration::CheckHolder}, 884 {"voidMethodDoubleArgFloatArg", V8TestInterface5::voidMethodDoubleArgFloatAr gMethodCallback, nullptr, 2, v8::None, V8DOMConfiguration::OnPrototype, V8DOMCon figuration::CheckHolder},
885 {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", TestInterface5Implem entationV8Internal::voidMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCal lback, 0, 2, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Chec kHolder}, 885 {"voidMethodUnrestrictedDoubleArgUnrestrictedFloatArg", V8TestInterface5::vo idMethodUnrestrictedDoubleArgUnrestrictedFloatArgMethodCallback, nullptr, 2, v8: :None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
886 {"voidMethod", TestInterface5ImplementationV8Internal::voidMethodMethodCallb ack, TestInterface5ImplementationV8Internal::voidMethodMethodCallbackForMainWorl d, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder }, 886 {"voidMethod", V8TestInterface5::voidMethodMethodCallback, V8TestInterface5: :voidMethodMethodCallbackForMainWorld, 0, v8::None, V8DOMConfiguration::OnProtot ype, V8DOMConfiguration::CheckHolder},
887 {"alwaysExposedMethod", TestInterface5ImplementationV8Internal::alwaysExpose dMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMCon figuration::CheckHolder}, 887 {"alwaysExposedMethod", V8TestInterface5::alwaysExposedMethodMethodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::Chec kHolder},
888 {"alwaysExposedStaticMethod", TestInterface5ImplementationV8Internal::always ExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::OnInterfa ce, V8DOMConfiguration::CheckHolder}, 888 {"alwaysExposedStaticMethod", V8TestInterface5::alwaysExposedStaticMethodMet hodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnInterface, V8DOMConfigu ration::CheckHolder},
889 {"voidMethodBooleanOrDOMStringArg", TestInterface5ImplementationV8Internal:: voidMethodBooleanOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguratio n::OnPrototype, V8DOMConfiguration::CheckHolder}, 889 {"voidMethodBooleanOrDOMStringArg", V8TestInterface5::voidMethodBooleanOrDOM StringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
890 {"voidMethodDoubleOrDOMStringArg", TestInterface5ImplementationV8Internal::v oidMethodDoubleOrDOMStringArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration: :OnPrototype, V8DOMConfiguration::CheckHolder}, 890 {"voidMethodDoubleOrDOMStringArg", V8TestInterface5::voidMethodDoubleOrDOMSt ringArgMethodCallback, nullptr, 1, v8::None, V8DOMConfiguration::OnPrototype, V8 DOMConfiguration::CheckHolder},
891 {"voidMethodVoidExperimentalCallbackFunction", TestInterface5ImplementationV 8Internal::voidMethodVoidExperimentalCallbackFunctionMethodCallback, 0, 1, v8::N one, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 891 {"voidMethodVoidExperimentalCallbackFunction", V8TestInterface5::voidMethodV oidExperimentalCallbackFunctionMethodCallback, nullptr, 1, v8::None, V8DOMConfig uration::OnPrototype, V8DOMConfiguration::CheckHolder},
892 {"voidMethodVoidCallbackFunctionModulesArg", TestInterface5ImplementationV8I nternal::voidMethodVoidCallbackFunctionModulesArgMethodCallback, 0, 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 892 {"voidMethodVoidCallbackFunctionModulesArg", V8TestInterface5::voidMethodVoi dCallbackFunctionModulesArgMethodCallback, nullptr, 1, v8::None, V8DOMConfigurat ion::OnPrototype, V8DOMConfiguration::CheckHolder},
893 {"keys", TestInterface5ImplementationV8Internal::keysMethodCallback, 0, 0, v 8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 893 {"keys", V8TestInterface5::keysMethodCallback, nullptr, 0, v8::None, V8DOMCo nfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
894 {"values", TestInterface5ImplementationV8Internal::valuesMethodCallback, 0, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}, 894 {"values", V8TestInterface5::valuesMethodCallback, nullptr, 0, v8::None, V8D OMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
895 {"entries", TestInterface5ImplementationV8Internal::entriesMethodCallback, 0 , 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder} , 895 {"entries", V8TestInterface5::entriesMethodCallback, nullptr, 0, v8::None, V 8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
896 {"forEach", TestInterface5ImplementationV8Internal::forEachMethodCallback, 0 , 1, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder} , 896 {"forEach", V8TestInterface5::forEachMethodCallback, nullptr, 1, v8::None, V 8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder},
897 {"toString", TestInterface5ImplementationV8Internal::toStringMethodCallback, 0, 0, static_cast<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::OnP rototype, V8DOMConfiguration::CheckHolder}, 897 {"toString", V8TestInterface5::toStringMethodCallback, nullptr, 0, static_ca st<v8::PropertyAttribute>(v8::DontEnum), V8DOMConfiguration::OnPrototype, V8DOMC onfiguration::CheckHolder},
898 }; 898 };
899 899
900 static void installV8TestInterface5Template(v8::Isolate* isolate, const DOMWrapp erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) { 900 static void installV8TestInterface5Template(v8::Isolate* isolate, const DOMWrapp erWorld& world, v8::Local<v8::FunctionTemplate> interfaceTemplate) {
901 // Initialize the interface object's template. 901 // Initialize the interface object's template.
902 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfaceEmpty::domTempl ate(isolate, world), V8TestInterface5::internalFieldCount); 902 V8DOMConfiguration::initializeDOMInterfaceTemplate(isolate, interfaceTemplate, V8TestInterface5::wrapperTypeInfo.interfaceName, V8TestInterfaceEmpty::domTempl ate(isolate, world), V8TestInterface5::internalFieldCount);
903 903
904 if (!RuntimeEnabledFeatures::featureNameEnabled()) { 904 if (!RuntimeEnabledFeatures::featureNameEnabled()) {
905 return; 905 return;
906 } 906 }
907 907
908 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late); 908 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late);
909 ALLOW_UNUSED_LOCAL(signature); 909 ALLOW_UNUSED_LOCAL(signature);
910 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTe mplate(); 910 v8::Local<v8::ObjectTemplate> instanceTemplate = interfaceTemplate->InstanceTe mplate();
911 ALLOW_UNUSED_LOCAL(instanceTemplate); 911 ALLOW_UNUSED_LOCAL(instanceTemplate);
912 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototype Template(); 912 v8::Local<v8::ObjectTemplate> prototypeTemplate = interfaceTemplate->Prototype Template();
913 ALLOW_UNUSED_LOCAL(prototypeTemplate); 913 ALLOW_UNUSED_LOCAL(prototypeTemplate);
914 914
915 // Register DOM constants, attributes and operations. 915 // Register DOM constants, attributes and operations.
916 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[] = { 916 const V8DOMConfiguration::ConstantConfiguration V8TestInterface5Constants[] = {
917 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong}, 917 {"UNSIGNED_LONG", 0, 0, V8DOMConfiguration::ConstantTypeUnsignedLong},
918 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort}, 918 {"CONST_JAVASCRIPT", 1, 0, V8DOMConfiguration::ConstantTypeShort},
919 }; 919 };
920 V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototypeTemp late, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants)); 920 V8DOMConfiguration::installConstants(isolate, interfaceTemplate, prototypeTemp late, V8TestInterface5Constants, WTF_ARRAY_LENGTH(V8TestInterface5Constants));
921 V8DOMConfiguration::installLazyDataAttributes(isolate, world, instanceTemplate , prototypeTemplate, V8TestInterface5LazyDataAttributes, WTF_ARRAY_LENGTH(V8Test Interface5LazyDataAttributes)); 921 V8DOMConfiguration::installLazyDataAttributes(isolate, world, instanceTemplate , prototypeTemplate, V8TestInterface5LazyDataAttributes, WTF_ARRAY_LENGTH(V8Test Interface5LazyDataAttributes));
922 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototy peTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_ARRAY_L ENGTH(V8TestInterface5Accessors)); 922 V8DOMConfiguration::installAccessors(isolate, world, instanceTemplate, prototy peTemplate, interfaceTemplate, signature, V8TestInterface5Accessors, WTF_ARRAY_L ENGTH(V8TestInterface5Accessors));
923 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototype Template, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY_LENGT H(V8TestInterface5Methods)); 923 V8DOMConfiguration::installMethods(isolate, world, instanceTemplate, prototype Template, interfaceTemplate, signature, V8TestInterface5Methods, WTF_ARRAY_LENGT H(V8TestInterface5Methods));
924 924
925 // Indexed properties 925 // Indexed properties
926 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(TestInter face5ImplementationV8Internal::indexedPropertyGetterCallback, TestInterface5Impl ementationV8Internal::indexedPropertySetterCallback, 0, TestInterface5Implementa tionV8Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestIn terface5Implementation>, v8::Local<v8::Value>(), v8::PropertyHandlerFlags::kNone ); 926 v8::IndexedPropertyHandlerConfiguration indexedPropertyHandlerConfig(V8TestInt erface5::indexedPropertyGetterCallback, V8TestInterface5::indexedPropertySetterC allback, nullptr, V8TestInterface5::indexedPropertyDeleterCallback, indexedPrope rtyEnumerator<TestInterface5Implementation>, v8::Local<v8::Value>(), v8::Propert yHandlerFlags::kNone);
927 instanceTemplate->SetHandler(indexedPropertyHandlerConfig); 927 instanceTemplate->SetHandler(indexedPropertyHandlerConfig);
928 // Named properties 928 // Named properties
929 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(TestInterface 5ImplementationV8Internal::namedPropertyGetterCallback, TestInterface5Implementa tionV8Internal::namedPropertySetterCallback, TestInterface5ImplementationV8Inter nal::namedPropertyQueryCallback, TestInterface5ImplementationV8Internal::namedPr opertyDeleterCallback, TestInterface5ImplementationV8Internal::namedPropertyEnum eratorCallback, v8::Local<v8::Value>(), static_cast<v8::PropertyHandlerFlags>(in t(v8::PropertyHandlerFlags::kOnlyInterceptStrings) | int(v8::PropertyHandlerFlag s::kNonMasking))); 929 v8::NamedPropertyHandlerConfiguration namedPropertyHandlerConfig(V8TestInterfa ce5::namedPropertyGetterCallback, V8TestInterface5::namedPropertySetterCallback, V8TestInterface5::namedPropertyQueryCallback, V8TestInterface5::namedPropertyDe leterCallback, V8TestInterface5::namedPropertyEnumeratorCallback, v8::Local<v8:: Value>(), static_cast<v8::PropertyHandlerFlags>(int(v8::PropertyHandlerFlags::kO nlyInterceptStrings) | int(v8::PropertyHandlerFlags::kNonMasking)));
930 instanceTemplate->SetHandler(namedPropertyHandlerConfig); 930 instanceTemplate->SetHandler(namedPropertyHandlerConfig);
931 931
932 // Iterator (@@iterator) 932 // Iterator (@@iterator)
933 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorCo nfiguration = { v8::Symbol::GetIterator, TestInterface5ImplementationV8Internal: :iteratorMethodCallback, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype }; 933 const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedIteratorCo nfiguration = { v8::Symbol::GetIterator, V8TestInterface5::iteratorMethodCallbac k, 0, v8::DontEnum, V8DOMConfiguration::OnPrototype };
934 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature , symbolKeyedIteratorConfiguration); 934 V8DOMConfiguration::installMethod(isolate, world, prototypeTemplate, signature , symbolKeyedIteratorConfiguration);
935 935
936 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCustom) ; 936 instanceTemplate->SetCallAsFunctionHandler(V8TestInterface5::legacyCallCustom) ;
937 } 937 }
938 938
939 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola te, const DOMWrapperWorld& world) { 939 v8::Local<v8::FunctionTemplate> V8TestInterface5::domTemplate(v8::Isolate* isola te, const DOMWrapperWorld& world) {
940 return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<Wrapper TypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template); 940 return V8DOMConfiguration::domClassTemplate(isolate, world, const_cast<Wrapper TypeInfo*>(&wrapperTypeInfo), installV8TestInterface5Template);
941 } 941 }
942 942
943 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is olate) { 943 bool V8TestInterface5::hasInstance(v8::Local<v8::Value> v8Value, v8::Isolate* is olate) {
944 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value) ; 944 return V8PerIsolateData::from(isolate)->hasInstance(&wrapperTypeInfo, v8Value) ;
945 } 945 }
946 946
947 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v 8::Value> v8Value, v8::Isolate* isolate) { 947 v8::Local<v8::Object> V8TestInterface5::findInstanceInPrototypeChain(v8::Local<v 8::Value> v8Value, v8::Isolate* isolate) {
948 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperT ypeInfo, v8Value); 948 return V8PerIsolateData::from(isolate)->findInstanceInPrototypeChain(&wrapperT ypeInfo, v8Value);
949 } 949 }
950 950
951 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) { 951 TestInterface5Implementation* V8TestInterface5::toImplWithTypeCheck(v8::Isolate* isolate, v8::Local<v8::Value> value) {
952 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value) ) : nullptr; 952 return hasInstance(value, isolate) ? toImpl(v8::Local<v8::Object>::Cast(value) ) : nullptr;
953 } 953 }
954 954
955 void V8TestInterface5::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v 8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfac eTemplate) { 955 void V8TestInterface5::preparePrototypeAndInterfaceObject(v8::Local<v8::Context> context, const DOMWrapperWorld& world, v8::Local<v8::Object> prototypeObject, v 8::Local<v8::Function> interfaceObject, v8::Local<v8::FunctionTemplate> interfac eTemplate) {
956 v8::Isolate* isolate = context->GetIsolate(); 956 v8::Isolate* isolate = context->GetIsolate();
957 ExecutionContext* executionContext = toExecutionContext(context); 957 ExecutionContext* executionContext = toExecutionContext(context);
958 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late); 958 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late);
959 if (executionContext && (executionContext->isWorkerGlobalScope())) { 959 if (executionContext && (executionContext->isWorkerGlobalScope())) {
960 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"wo rkerExposedAttribute", TestInterface5ImplementationV8Internal::workerExposedAttr ibuteAttributeGetterCallback, TestInterface5ImplementationV8Internal::workerExpo sedAttributeAttributeSetterCallback, 0, 0, nullptr, 0, static_cast<v8::PropertyA ttribute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckH older}; 960 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"wo rkerExposedAttribute", V8TestInterface5::workerExposedAttributeAttributeGetterCa llback, V8TestInterface5::workerExposedAttributeAttributeSetterCallback, nullptr , nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOM Configuration::OnPrototype, V8DOMConfiguration::CheckHolder};
961 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfiguration); 961 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfiguration);
962 } 962 }
963 if (executionContext && (executionContext->isDocument())) { 963 if (executionContext && (executionContext->isDocument())) {
964 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"wi ndowExposedAttribute", TestInterface5ImplementationV8Internal::windowExposedAttr ibuteAttributeGetterCallback, TestInterface5ImplementationV8Internal::windowExpo sedAttributeAttributeSetterCallback, 0, 0, nullptr, 0, static_cast<v8::PropertyA ttribute>(v8::None), V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckH older}; 964 const V8DOMConfiguration::AccessorConfiguration accessorConfiguration = {"wi ndowExposedAttribute", V8TestInterface5::windowExposedAttributeAttributeGetterCa llback, V8TestInterface5::windowExposedAttributeAttributeSetterCallback, nullptr , nullptr, nullptr, nullptr, static_cast<v8::PropertyAttribute>(v8::None), V8DOM Configuration::OnPrototype, V8DOMConfiguration::CheckHolder};
965 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfiguration); 965 V8DOMConfiguration::installAccessor(isolate, world, v8::Local<v8::Object>(), prototypeObject, interfaceObject, signature, accessorConfiguration);
966 } 966 }
967 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late); 967 v8::Local<v8::Signature> signature = v8::Signature::New(isolate, interfaceTemp late);
968 ExecutionContext* executionContext = toExecutionContext(prototypeObject->Creat ionContext()); 968 ExecutionContext* executionContext = toExecutionContext(prototypeObject->Creat ionContext());
969 DCHECK(executionContext); 969 DCHECK(executionContext);
970 if (executionContext && (executionContext->isWorkerGlobalScope())) { 970 if (executionContext && (executionContext->isWorkerGlobalScope())) {
971 const V8DOMConfiguration::MethodConfiguration workerExposedMethodMethodConfi guration = {"workerExposedMethod", TestInterface5ImplementationV8Internal::worke rExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::OnPrototype, V 8DOMConfiguration::CheckHolder}; 971 const V8DOMConfiguration::MethodConfiguration workerExposedMethodMethodConfi guration = {"workerExposedMethod", V8TestInterface5::workerExposedMethodMethodCa llback, nullptr, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguratio n::CheckHolder};
972 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, workerExposedMethodMethodConfigurati on); 972 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, workerExposedMethodMethodConfigurati on);
973 } 973 }
974 if (executionContext && (executionContext->isDocument())) { 974 if (executionContext && (executionContext->isDocument())) {
975 const V8DOMConfiguration::MethodConfiguration windowExposedMethodMethodConfi guration = {"windowExposedMethod", TestInterface5ImplementationV8Internal::windo wExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::OnPrototype, V 8DOMConfiguration::CheckHolder}; 975 const V8DOMConfiguration::MethodConfiguration windowExposedMethodMethodConfi guration = {"windowExposedMethod", V8TestInterface5::windowExposedMethodMethodCa llback, nullptr, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguratio n::CheckHolder};
976 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, windowExposedMethodMethodConfigurati on); 976 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, windowExposedMethodMethodConfigurati on);
977 } 977 }
978 if (executionContext && (executionContext->isWorkerGlobalScope())) { 978 if (executionContext && (executionContext->isWorkerGlobalScope())) {
979 const V8DOMConfiguration::MethodConfiguration workerExposedStaticMethodMetho dConfiguration = {"workerExposedStaticMethod", TestInterface5ImplementationV8Int ernal::workerExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigurati on::OnInterface, V8DOMConfiguration::CheckHolder}; 979 const V8DOMConfiguration::MethodConfiguration workerExposedStaticMethodMetho dConfiguration = {"workerExposedStaticMethod", V8TestInterface5::workerExposedSt aticMethodMethodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnInterface, V8DOMConfiguration::CheckHolder};
980 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, workerExposedStaticMethodMethodConfi guration); 980 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, workerExposedStaticMethodMethodConfi guration);
981 } 981 }
982 if (executionContext && (executionContext->isDocument())) { 982 if (executionContext && (executionContext->isDocument())) {
983 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMetho dConfiguration = {"windowExposedStaticMethod", TestInterface5ImplementationV8Int ernal::windowExposedStaticMethodMethodCallback, 0, 0, v8::None, V8DOMConfigurati on::OnInterface, V8DOMConfiguration::CheckHolder}; 983 const V8DOMConfiguration::MethodConfiguration windowExposedStaticMethodMetho dConfiguration = {"windowExposedStaticMethod", V8TestInterface5::windowExposedSt aticMethodMethodCallback, nullptr, 0, v8::None, V8DOMConfiguration::OnInterface, V8DOMConfiguration::CheckHolder};
984 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodConfi guration); 984 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, windowExposedStaticMethodMethodConfi guration);
985 } 985 }
986 if (executionContext && (executionContext->isDocument() || executionContext->i sServiceWorkerGlobalScope())) { 986 if (executionContext && (executionContext->isDocument() || executionContext->i sServiceWorkerGlobalScope())) {
987 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM ethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", TestInterface 5ImplementationV8Internal::windowAndServiceWorkerExposedMethodMethodCallback, 0, 0, v8::None, V8DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder}; 987 const V8DOMConfiguration::MethodConfiguration windowAndServiceWorkerExposedM ethodMethodConfiguration = {"windowAndServiceWorkerExposedMethod", V8TestInterfa ce5::windowAndServiceWorkerExposedMethodMethodCallback, nullptr, 0, v8::None, V8 DOMConfiguration::OnPrototype, V8DOMConfiguration::CheckHolder};
988 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodM ethodConfiguration); 988 V8DOMConfiguration::installMethod(isolate, world, v8::Local<v8::Object>(), p rototypeObject, interfaceObject, signature, windowAndServiceWorkerExposedMethodM ethodConfiguration);
989 } 989 }
990 } 990 }
991 991
992 } // namespace blink 992 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698