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

Side by Side Diff: Source/bindings/tests/results/core/V8TestInterface2.cpp

Issue 807263007: IDL: Add forEach() method to iterable<>/maplike<>/setlike<> interfaces (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestInterface2.h" 8 #include "V8TestInterface2.h"
9 9
10 #include "bindings/core/v8/ExceptionState.h" 10 #include "bindings/core/v8/ExceptionState.h"
11 #include "bindings/core/v8/ScriptState.h" 11 #include "bindings/core/v8/ScriptState.h"
12 #include "bindings/core/v8/ScriptValue.h"
12 #include "bindings/core/v8/V8DOMConfiguration.h" 13 #include "bindings/core/v8/V8DOMConfiguration.h"
13 #include "bindings/core/v8/V8GCController.h" 14 #include "bindings/core/v8/V8GCController.h"
14 #include "bindings/core/v8/V8HiddenValue.h" 15 #include "bindings/core/v8/V8HiddenValue.h"
15 #include "bindings/core/v8/V8Iterator.h" 16 #include "bindings/core/v8/V8Iterator.h"
16 #include "bindings/core/v8/V8ObjectConstructor.h" 17 #include "bindings/core/v8/V8ObjectConstructor.h"
17 #include "bindings/core/v8/V8TestInterfaceEmpty.h" 18 #include "bindings/core/v8/V8TestInterfaceEmpty.h"
18 #include "core/dom/ContextFeatures.h" 19 #include "core/dom/ContextFeatures.h"
19 #include "core/dom/Document.h" 20 #include "core/dom/Document.h"
20 #include "core/dom/Element.h" 21 #include "core/dom/Element.h"
21 #include "core/frame/LocalDOMWindow.h" 22 #include "core/frame/LocalDOMWindow.h"
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 v8SetReturnValue(info, result.release()); 274 v8SetReturnValue(info, result.release());
274 } 275 }
275 276
276 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 277 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
277 { 278 {
278 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 279 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
279 TestInterface2V8Internal::entriesMethod(info); 280 TestInterface2V8Internal::entriesMethod(info);
280 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 281 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
281 } 282 }
282 283
284 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
285 {
286 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", " TestInterface2", info.Holder(), info.GetIsolate());
287 if (UNLIKELY(info.Length() < 1)) {
288 setMinimumArityTypeError(exceptionState, 1, info.Length());
289 exceptionState.throwIfNeeded();
290 return;
291 }
292 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
293 ScriptValue callback;
294 ScriptValue thisArg;
295 {
296 if (!info[0]->IsFunction()) {
297 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
298 exceptionState.throwIfNeeded();
299 return;
300 }
301 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]) ;
302 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
303 }
304 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
305 impl->forEach(scriptState, ScriptValue(scriptState, info.This()), callback, thisArg, exceptionState);
306 if (exceptionState.hadException()) {
307 exceptionState.throwIfNeeded();
308 return;
309 }
310 }
311
312 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
313 {
314 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
315 TestInterface2V8Internal::forEachMethod(info);
316 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
317 }
318
283 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 319 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
284 { 320 {
285 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 321 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
286 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); 322 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate());
287 } 323 }
288 324
289 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 325 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
290 { 326 {
291 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 327 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
292 TestInterface2V8Internal::toStringMethod(info); 328 TestInterface2V8Internal::toStringMethod(info);
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 {"item", TestInterface2V8Internal::itemMethodCallback, 0, 1, V8DOMConfigurat ion::ExposedToAllScripts}, 557 {"item", TestInterface2V8Internal::itemMethodCallback, 0, 1, V8DOMConfigurat ion::ExposedToAllScripts},
522 {"setItem", TestInterface2V8Internal::setItemMethodCallback, 0, 2, V8DOMConf iguration::ExposedToAllScripts}, 558 {"setItem", TestInterface2V8Internal::setItemMethodCallback, 0, 2, V8DOMConf iguration::ExposedToAllScripts},
523 {"deleteItem", TestInterface2V8Internal::deleteItemMethodCallback, 0, 1, V8D OMConfiguration::ExposedToAllScripts}, 559 {"deleteItem", TestInterface2V8Internal::deleteItemMethodCallback, 0, 1, V8D OMConfiguration::ExposedToAllScripts},
524 {"namedItem", TestInterface2V8Internal::namedItemMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts}, 560 {"namedItem", TestInterface2V8Internal::namedItemMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts},
525 {"setNamedItem", TestInterface2V8Internal::setNamedItemMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, 561 {"setNamedItem", TestInterface2V8Internal::setNamedItemMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts},
526 {"deleteNamedItem", TestInterface2V8Internal::deleteNamedItemMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 562 {"deleteNamedItem", TestInterface2V8Internal::deleteNamedItemMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
527 {"stringifierMethod", TestInterface2V8Internal::stringifierMethodMethodCallb ack, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 563 {"stringifierMethod", TestInterface2V8Internal::stringifierMethodMethodCallb ack, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
528 {"keys", TestInterface2V8Internal::keysMethodCallback, 0, 0, V8DOMConfigurat ion::ExposedToAllScripts}, 564 {"keys", TestInterface2V8Internal::keysMethodCallback, 0, 0, V8DOMConfigurat ion::ExposedToAllScripts},
529 {"values", TestInterface2V8Internal::valuesMethodCallback, 0, 0, V8DOMConfig uration::ExposedToAllScripts}, 565 {"values", TestInterface2V8Internal::valuesMethodCallback, 0, 0, V8DOMConfig uration::ExposedToAllScripts},
530 {"entries", TestInterface2V8Internal::entriesMethodCallback, 0, 0, V8DOMConf iguration::ExposedToAllScripts}, 566 {"entries", TestInterface2V8Internal::entriesMethodCallback, 0, 0, V8DOMConf iguration::ExposedToAllScripts},
567 {"forEach", TestInterface2V8Internal::forEachMethodCallback, 0, 1, V8DOMConf iguration::ExposedToAllScripts},
531 {"toString", TestInterface2V8Internal::toStringMethodCallback, 0, 0, V8DOMCo nfiguration::ExposedToAllScripts}, 568 {"toString", TestInterface2V8Internal::toStringMethodCallback, 0, 0, V8DOMCo nfiguration::ExposedToAllScripts},
532 }; 569 };
533 570
534 void V8TestInterface2::constructorCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 571 void V8TestInterface2::constructorCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
535 { 572 {
536 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); 573 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor");
537 if (!info.IsConstructCall()) { 574 if (!info.IsConstructCall()) {
538 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c onstructorNotCallableAsFunction("TestInterface2")); 575 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c onstructorNotCallableAsFunction("TestInterface2"));
539 return; 576 return;
540 } 577 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
600 { 637 {
601 scriptWrappable->toImpl<TestInterface2>()->ref(); 638 scriptWrappable->toImpl<TestInterface2>()->ref();
602 } 639 }
603 640
604 void V8TestInterface2::derefObject(ScriptWrappable* scriptWrappable) 641 void V8TestInterface2::derefObject(ScriptWrappable* scriptWrappable)
605 { 642 {
606 scriptWrappable->toImpl<TestInterface2>()->deref(); 643 scriptWrappable->toImpl<TestInterface2>()->deref();
607 } 644 }
608 645
609 } // namespace blink 646 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698