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

Side by Side Diff: Source/bindings/tests/results/V8TestInterface.cpp

Issue 483163003: Introduce ES6 iterator for DOM objects. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 #if ENABLE(CONDITION) 8 #if ENABLE(CONDITION)
9 #include "V8TestInterface.h" 9 #include "V8TestInterface.h"
10 10
11 #include "bindings/core/v8/ExceptionState.h" 11 #include "bindings/core/v8/ExceptionState.h"
12 #include "bindings/core/v8/PrivateScriptRunner.h" 12 #include "bindings/core/v8/PrivateScriptRunner.h"
13 #include "bindings/core/v8/ScriptState.h"
13 #include "bindings/core/v8/ScriptValue.h" 14 #include "bindings/core/v8/ScriptValue.h"
14 #include "bindings/core/v8/V8AbstractEventListener.h" 15 #include "bindings/core/v8/V8AbstractEventListener.h"
15 #include "bindings/core/v8/V8DOMConfiguration.h" 16 #include "bindings/core/v8/V8DOMConfiguration.h"
16 #include "bindings/core/v8/V8EventListenerList.h" 17 #include "bindings/core/v8/V8EventListenerList.h"
17 #include "bindings/core/v8/V8HiddenValue.h" 18 #include "bindings/core/v8/V8HiddenValue.h"
19 #include "bindings/core/v8/V8Iterator.h"
18 #include "bindings/core/v8/V8ObjectConstructor.h" 20 #include "bindings/core/v8/V8ObjectConstructor.h"
19 #include "bindings/tests/idls/TestImplements2.h" 21 #include "bindings/tests/idls/TestImplements2.h"
20 #include "bindings/tests/idls/TestImplements3Implementation.h" 22 #include "bindings/tests/idls/TestImplements3Implementation.h"
21 #include "bindings/tests/idls/TestPartialInterface.h" 23 #include "bindings/tests/idls/TestPartialInterface.h"
22 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h" 24 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h"
25 #include "bindings/tests/v8/V8Iterator.h"
Jens Widell 2014/08/21 13:58:02 Please help me out: I don't understand why this #i
yhirano 2014/08/25 06:09:26 I don't know either. Given that V8Node.h is in the
23 #include "bindings/tests/v8/V8Node.h" 26 #include "bindings/tests/v8/V8Node.h"
24 #include "bindings/tests/v8/V8TestInterface.h" 27 #include "bindings/tests/v8/V8TestInterface.h"
25 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" 28 #include "bindings/tests/v8/V8TestInterfaceEmpty.h"
26 #include "core/dom/ContextFeatures.h" 29 #include "core/dom/ContextFeatures.h"
27 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
28 #include "core/frame/LocalFrame.h" 31 #include "core/frame/LocalFrame.h"
29 #include "platform/RuntimeEnabledFeatures.h" 32 #include "platform/RuntimeEnabledFeatures.h"
30 #include "platform/ScriptForbiddenScope.h" 33 #include "platform/ScriptForbiddenScope.h"
31 #include "platform/TraceEvent.h" 34 #include "platform/TraceEvent.h"
32 #include "wtf/GetPtr.h" 35 #include "wtf/GetPtr.h"
(...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after
1408 v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); 1411 v8SetReturnValueString(info, impl->toString(), info.GetIsolate());
1409 } 1412 }
1410 1413
1411 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo) 1414 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
1412 { 1415 {
1413 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); 1416 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1414 TestInterfaceImplementationV8Internal::toStringMethod(info); 1417 TestInterfaceImplementationV8Internal::toStringMethod(info);
1415 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); 1418 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
1416 } 1419 }
1417 1420
1421 namespace symbol {
Jens Widell 2014/08/21 13:58:02 Nit: it would be nice with a blank after this line
haraken 2014/08/21 16:15:58 I guess we can just use "iteratorMethod" until it
yhirano 2014/08/25 06:09:26 OK, I deleted the namespace. Let's think about the
yhirano 2014/08/25 06:09:26 Deleted
1422 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info)
1423 {
1424 ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", "TestInterface", info.Holder(), info.GetIsolate());
1425 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
1426 ScriptState* scriptState = ScriptState::current(info.GetIsolate());
1427 RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState);
1428 if (exceptionState.hadException()) {
1429 exceptionState.throwIfNeeded();
1430 return;
1431 }
1432 v8SetReturnValue(info, result.release());
1433 }
1434
1435 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in fo)
1436 {
1437 TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod");
1438 TestInterfaceImplementationV8Internal::symbol::iteratorMethod(info);
1439 TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution");
1440 }
1441
1442 } // namespace symbol
1418 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info) 1443 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo <v8::Value>& info)
1419 { 1444 {
1420 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ; 1445 TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder()) ;
1421 String result = impl->anonymousIndexedGetter(index); 1446 String result = impl->anonymousIndexedGetter(index);
1422 if (result.isNull()) 1447 if (result.isNull())
1423 return; 1448 return;
1424 v8SetReturnValueString(info, result, info.GetIsolate()); 1449 v8SetReturnValueString(info, result, info.GetIsolate());
1425 } 1450 }
1426 1451
1427 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info) 1452 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall backInfo<v8::Value>& info)
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
1669 {"IMPLEMENTS_CONSTANT_2", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort}, 1694 {"IMPLEMENTS_CONSTANT_2", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort},
1670 {"PARTIAL2_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns ignedShort}, 1695 {"PARTIAL2_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns ignedShort},
1671 }; 1696 };
1672 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); 1697 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8 TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate);
1673 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { 1698 if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) {
1674 static const V8DOMConfiguration::ConstantConfiguration constantConfigura tion = {"PARTIAL_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort}; 1699 static const V8DOMConfiguration::ConstantConfiguration constantConfigura tion = {"PARTIAL_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsig nedShort};
1675 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate , &constantConfiguration, 1, isolate); 1700 V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate , &constantConfiguration, 1, isolate);
1676 } 1701 }
1677 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterfac eImplementationV8Internal::indexedPropertyGetterCallback, TestInterfaceImplement ationV8Internal::indexedPropertySetterCallback, 0, TestInterfaceImplementationV8 Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterfac eImplementation>); 1702 functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterfac eImplementationV8Internal::indexedPropertyGetterCallback, TestInterfaceImplement ationV8Internal::indexedPropertySetterCallback, 0, TestInterfaceImplementationV8 Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterfac eImplementation>);
1678 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceI mplementationV8Internal::namedPropertyGetterCallback, TestInterfaceImplementatio nV8Internal::namedPropertySetterCallback, TestInterfaceImplementationV8Internal: :namedPropertyQueryCallback, TestInterfaceImplementationV8Internal::namedPropert yDeleterCallback, TestInterfaceImplementationV8Internal::namedPropertyEnumerator Callback); 1703 functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceI mplementationV8Internal::namedPropertyGetterCallback, TestInterfaceImplementatio nV8Internal::namedPropertySetterCallback, TestInterfaceImplementationV8Internal: :namedPropertyQueryCallback, TestInterfaceImplementationV8Internal::namedPropert yDeleterCallback, TestInterfaceImplementationV8Internal::namedPropertyEnumerator Callback);
1704 static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolIterat orConfiguration = { v8::Symbol::GetIterator, TestInterfaceImplementationV8Intern al::symbol::iteratorMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScript s };
1705 V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::D ontDelete, symbolIteratorConfiguration, isolate);
1679 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom); 1706 functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa ce::legacyCallCustom);
1680 static const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMeth odMethodConfiguration = { 1707 static const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMeth odMethodConfiguration = {
1681 "alwaysExposedStaticMethod", TestInterfaceImplementationV8Internal::alwa ysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScrip ts, 1708 "alwaysExposedStaticMethod", TestInterfaceImplementationV8Internal::alwa ysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScrip ts,
1682 }; 1709 };
1683 V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature> (), v8::None, alwaysExposedStaticMethodMethodConfiguration, isolate); 1710 V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature> (), v8::None, alwaysExposedStaticMethodMethodConfiguration, isolate);
1684 static const V8DOMConfiguration::MethodConfiguration implementsStaticVoidMet hodMethodConfiguration = { 1711 static const V8DOMConfiguration::MethodConfiguration implementsStaticVoidMet hodMethodConfiguration = {
1685 "implementsStaticVoidMethod", TestInterfaceImplementationV8Internal::imp lementsStaticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScr ipts, 1712 "implementsStaticVoidMethod", TestInterfaceImplementationV8Internal::imp lementsStaticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScr ipts,
1686 }; 1713 };
1687 V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature> (), v8::None, implementsStaticVoidMethodMethodConfiguration, isolate); 1714 V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature> (), v8::None, implementsStaticVoidMethodMethodConfiguration, isolate);
1688 if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) { 1715 if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) {
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
1951 RELEASE_ASSERT_NOT_REACHED(); 1978 RELEASE_ASSERT_NOT_REACHED();
1952 } 1979 }
1953 block.ReThrow(); 1980 block.ReThrow();
1954 return false; 1981 return false;
1955 } 1982 }
1956 return true; 1983 return true;
1957 } 1984 }
1958 1985
1959 } // namespace blink 1986 } // namespace blink
1960 #endif // ENABLE(CONDITION) 1987 #endif // ENABLE(CONDITION)
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698