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

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: adjust test expectations 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 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 v8SetReturnValue(info, result.release()); 284 v8SetReturnValue(info, result.release());
284 } 285 }
285 286
286 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o) 287 static void entriesMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
287 { 288 {
288 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 289 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
289 TestInterface2V8Internal::entriesMethod(info); 290 TestInterface2V8Internal::entriesMethod(info);
290 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 291 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
291 } 292 }
292 293
294 static void forEachMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
295 {
296 ExceptionState exceptionState(ExceptionState::ExecutionContext, "forEach", " TestInterface2", info.Holder(), info.GetIsolate());
297 if (UNLIKELY(info.Length() < 1)) {
298 setMinimumArityTypeError(exceptionState, 1, info.Length());
299 exceptionState.throwIfNeeded();
300 return;
301 }
302 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
303 ScriptValue callback;
304 ScriptValue thisArg;
305 {
306 if (!info[0]->IsFunction()) {
307 exceptionState.throwTypeError("The callback provided as parameter 1 is not a function.");
308 exceptionState.throwIfNeeded();
309 return;
310 }
311 callback = ScriptValue(ScriptState::current(info.GetIsolate()), info[0]) ;
312 thisArg = ScriptValue(ScriptState::current(info.GetIsolate()), info[1]);
313 }
314 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
315 impl->forEach(scriptState, ScriptValue(scriptState, info.This()), callback, thisArg, exceptionState);
316 if (exceptionState.hadException()) {
317 exceptionState.throwIfNeeded();
318 return;
319 }
320 }
321
322 static void forEachMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& inf o)
323 {
324 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
325 TestInterface2V8Internal::forEachMethod(info);
326 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
327 }
328
293 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info) 329 static void toStringMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
294 { 330 {
295 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder()); 331 TestInterface2* impl = V8TestInterface2::toImpl(info.Holder());
296 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate()); 332 v8SetReturnValueString(info, impl->stringifierMethod(), info.GetIsolate());
297 } 333 }
298 334
299 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 335 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
300 { 336 {
301 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 337 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
302 TestInterface2V8Internal::toStringMethod(info); 338 TestInterface2V8Internal::toStringMethod(info);
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after
541 {"item", TestInterface2V8Internal::itemMethodCallback, 0, 1, V8DOMConfigurat ion::ExposedToAllScripts}, 577 {"item", TestInterface2V8Internal::itemMethodCallback, 0, 1, V8DOMConfigurat ion::ExposedToAllScripts},
542 {"setItem", TestInterface2V8Internal::setItemMethodCallback, 0, 2, V8DOMConf iguration::ExposedToAllScripts}, 578 {"setItem", TestInterface2V8Internal::setItemMethodCallback, 0, 2, V8DOMConf iguration::ExposedToAllScripts},
543 {"deleteItem", TestInterface2V8Internal::deleteItemMethodCallback, 0, 1, V8D OMConfiguration::ExposedToAllScripts}, 579 {"deleteItem", TestInterface2V8Internal::deleteItemMethodCallback, 0, 1, V8D OMConfiguration::ExposedToAllScripts},
544 {"namedItem", TestInterface2V8Internal::namedItemMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts}, 580 {"namedItem", TestInterface2V8Internal::namedItemMethodCallback, 0, 1, V8DOM Configuration::ExposedToAllScripts},
545 {"setNamedItem", TestInterface2V8Internal::setNamedItemMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts}, 581 {"setNamedItem", TestInterface2V8Internal::setNamedItemMethodCallback, 0, 2, V8DOMConfiguration::ExposedToAllScripts},
546 {"deleteNamedItem", TestInterface2V8Internal::deleteNamedItemMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts}, 582 {"deleteNamedItem", TestInterface2V8Internal::deleteNamedItemMethodCallback, 0, 1, V8DOMConfiguration::ExposedToAllScripts},
547 {"stringifierMethod", TestInterface2V8Internal::stringifierMethodMethodCallb ack, 0, 0, V8DOMConfiguration::ExposedToAllScripts}, 583 {"stringifierMethod", TestInterface2V8Internal::stringifierMethodMethodCallb ack, 0, 0, V8DOMConfiguration::ExposedToAllScripts},
548 {"keys", TestInterface2V8Internal::keysMethodCallback, 0, 0, V8DOMConfigurat ion::ExposedToAllScripts}, 584 {"keys", TestInterface2V8Internal::keysMethodCallback, 0, 0, V8DOMConfigurat ion::ExposedToAllScripts},
549 {"values", TestInterface2V8Internal::valuesMethodCallback, 0, 0, V8DOMConfig uration::ExposedToAllScripts}, 585 {"values", TestInterface2V8Internal::valuesMethodCallback, 0, 0, V8DOMConfig uration::ExposedToAllScripts},
550 {"entries", TestInterface2V8Internal::entriesMethodCallback, 0, 0, V8DOMConf iguration::ExposedToAllScripts}, 586 {"entries", TestInterface2V8Internal::entriesMethodCallback, 0, 0, V8DOMConf iguration::ExposedToAllScripts},
587 {"forEach", TestInterface2V8Internal::forEachMethodCallback, 0, 1, V8DOMConf iguration::ExposedToAllScripts},
551 {"toString", TestInterface2V8Internal::toStringMethodCallback, 0, 0, V8DOMCo nfiguration::ExposedToAllScripts}, 588 {"toString", TestInterface2V8Internal::toStringMethodCallback, 0, 0, V8DOMCo nfiguration::ExposedToAllScripts},
552 }; 589 };
553 590
554 void V8TestInterface2::constructorCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info) 591 void V8TestInterface2::constructorCallback(const v8::FunctionCallbackInfo<v8::Va lue>& info)
555 { 592 {
556 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor"); 593 TRACE_EVENT_SCOPED_SAMPLING_STATE("blink", "DOMConstructor");
557 if (!info.IsConstructCall()) { 594 if (!info.IsConstructCall()) {
558 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c onstructorNotCallableAsFunction("TestInterface2")); 595 V8ThrowException::throwTypeError(info.GetIsolate(), ExceptionMessages::c onstructorNotCallableAsFunction("TestInterface2"));
559 return; 596 return;
560 } 597 }
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 { 657 {
621 scriptWrappable->toImpl<TestInterface2>()->ref(); 658 scriptWrappable->toImpl<TestInterface2>()->ref();
622 } 659 }
623 660
624 void V8TestInterface2::derefObject(ScriptWrappable* scriptWrappable) 661 void V8TestInterface2::derefObject(ScriptWrappable* scriptWrappable)
625 { 662 {
626 scriptWrappable->toImpl<TestInterface2>()->deref(); 663 scriptWrappable->toImpl<TestInterface2>()->deref();
627 } 664 }
628 665
629 } // namespace blink 666 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/scripts/v8_utilities.py ('k') | Source/bindings/tests/results/core/V8TestInterface3.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698