| OLD | NEW | 
|     1 // Copyright 2014 The Chromium Authors. All rights reserved. |     1 // Copyright 2014 The Chromium Authors. All rights reserved. | 
|     2 // Use of this source code is governed by a BSD-style license that can be |     2 // Use of this source code is governed by a BSD-style license that can be | 
|     3 // found in the LICENSE file. |     3 // found in the LICENSE file. | 
|     4  |     4  | 
|     5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! |     5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! | 
|     6  |     6  | 
|     7 #include "config.h" |     7 #include "config.h" | 
|     8 #if ENABLE(CONDITION) |     8 #if ENABLE(CONDITION) | 
|     9 #include "V8TestInterface.h" |     9 #include "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" | 
|    18 #include "bindings/core/v8/V8ObjectConstructor.h" |    19 #include "bindings/core/v8/V8ObjectConstructor.h" | 
|    19 #include "bindings/tests/idls/TestImplements2.h" |    20 #include "bindings/tests/idls/TestImplements2.h" | 
|    20 #include "bindings/tests/idls/TestImplements3Implementation.h" |    21 #include "bindings/tests/idls/TestImplements3Implementation.h" | 
|    21 #include "bindings/tests/idls/TestPartialInterface.h" |    22 #include "bindings/tests/idls/TestPartialInterface.h" | 
|    22 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h" |    23 #include "bindings/tests/idls/TestPartialInterfaceImplementation.h" | 
 |    24 #include "bindings/tests/v8/V8Iterator.h" | 
|    23 #include "bindings/tests/v8/V8Node.h" |    25 #include "bindings/tests/v8/V8Node.h" | 
|    24 #include "bindings/tests/v8/V8TestInterface.h" |    26 #include "bindings/tests/v8/V8TestInterface.h" | 
|    25 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" |    27 #include "bindings/tests/v8/V8TestInterfaceEmpty.h" | 
|    26 #include "core/dom/ContextFeatures.h" |    28 #include "core/dom/ContextFeatures.h" | 
|    27 #include "core/dom/Document.h" |    29 #include "core/dom/Document.h" | 
|    28 #include "core/frame/LocalFrame.h" |    30 #include "core/frame/LocalFrame.h" | 
|    29 #include "platform/RuntimeEnabledFeatures.h" |    31 #include "platform/RuntimeEnabledFeatures.h" | 
|    30 #include "platform/ScriptForbiddenScope.h" |    32 #include "platform/ScriptForbiddenScope.h" | 
|    31 #include "platform/TraceEvent.h" |    33 #include "platform/TraceEvent.h" | 
|    32 #include "wtf/GetPtr.h" |    34 #include "wtf/GetPtr.h" | 
| (...skipping 1375 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1408     v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); |  1410     v8SetReturnValueString(info, impl->toString(), info.GetIsolate()); | 
|  1409 } |  1411 } | 
|  1410  |  1412  | 
|  1411 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
      fo) |  1413 static void toStringMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
      fo) | 
|  1412 { |  1414 { | 
|  1413     TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); |  1415     TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 
|  1414     TestInterfaceImplementationV8Internal::toStringMethod(info); |  1416     TestInterfaceImplementationV8Internal::toStringMethod(info); | 
|  1415     TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); |  1417     TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 
|  1416 } |  1418 } | 
|  1417  |  1419  | 
 |  1420 static void iteratorMethod(const v8::FunctionCallbackInfo<v8::Value>& info) | 
 |  1421 { | 
 |  1422     ExceptionState exceptionState(ExceptionState::ExecutionContext, "iterator", 
      "TestInterface", info.Holder(), info.GetIsolate()); | 
 |  1423     TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
      ; | 
 |  1424     ScriptState* scriptState = ScriptState::current(info.GetIsolate()); | 
 |  1425     RawPtr<Iterator> result = impl->iterator(scriptState, exceptionState); | 
 |  1426     if (exceptionState.hadException()) { | 
 |  1427         exceptionState.throwIfNeeded(); | 
 |  1428         return; | 
 |  1429     } | 
 |  1430     v8SetReturnValue(info, result.release()); | 
 |  1431 } | 
 |  1432  | 
 |  1433 static void iteratorMethodCallback(const v8::FunctionCallbackInfo<v8::Value>& in
      fo) | 
 |  1434 { | 
 |  1435     TRACE_EVENT_SET_SAMPLING_STATE("blink", "DOMMethod"); | 
 |  1436     TestInterfaceImplementationV8Internal::iteratorMethod(info); | 
 |  1437     TRACE_EVENT_SET_SAMPLING_STATE("v8", "V8Execution"); | 
 |  1438 } | 
 |  1439  | 
|  1418 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
      <v8::Value>& info) |  1440 static void indexedPropertyGetter(uint32_t index, const v8::PropertyCallbackInfo
      <v8::Value>& info) | 
|  1419 { |  1441 { | 
|  1420     TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
      ; |  1442     TestInterfaceImplementation* impl = V8TestInterface::toNative(info.Holder())
      ; | 
|  1421     String result = impl->anonymousIndexedGetter(index); |  1443     String result = impl->anonymousIndexedGetter(index); | 
|  1422     if (result.isNull()) |  1444     if (result.isNull()) | 
|  1423         return; |  1445         return; | 
|  1424     v8SetReturnValueString(info, result, info.GetIsolate()); |  1446     v8SetReturnValueString(info, result, info.GetIsolate()); | 
|  1425 } |  1447 } | 
|  1426  |  1448  | 
|  1427 static void indexedPropertyGetterCallback(uint32_t index, const v8::PropertyCall
      backInfo<v8::Value>& info) |  1449 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  Loading... | 
|  1669         {"IMPLEMENTS_CONSTANT_2", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsig
      nedShort}, |  1691         {"IMPLEMENTS_CONSTANT_2", 2, 0, 0, V8DOMConfiguration::ConstantTypeUnsig
      nedShort}, | 
|  1670         {"PARTIAL2_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns
      ignedShort}, |  1692         {"PARTIAL2_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUns
      ignedShort}, | 
|  1671     }; |  1693     }; | 
|  1672     V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
      TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); |  1694     V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate, V8
      TestInterfaceConstants, WTF_ARRAY_LENGTH(V8TestInterfaceConstants), isolate); | 
|  1673     if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { |  1695     if (RuntimeEnabledFeatures::partialFeatureNameEnabled()) { | 
|  1674         static const V8DOMConfiguration::ConstantConfiguration constantConfigura
      tion = {"PARTIAL_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsig
      nedShort}; |  1696         static const V8DOMConfiguration::ConstantConfiguration constantConfigura
      tion = {"PARTIAL_UNSIGNED_SHORT", 0, 0, 0, V8DOMConfiguration::ConstantTypeUnsig
      nedShort}; | 
|  1675         V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate
      , &constantConfiguration, 1, isolate); |  1697         V8DOMConfiguration::installConstants(functionTemplate, prototypeTemplate
      , &constantConfiguration, 1, isolate); | 
|  1676     } |  1698     } | 
|  1677     functionTemplate->InstanceTemplate()->SetIndexedPropertyHandler(TestInterfac
      eImplementationV8Internal::indexedPropertyGetterCallback, TestInterfaceImplement
      ationV8Internal::indexedPropertySetterCallback, 0, TestInterfaceImplementationV8
      Internal::indexedPropertyDeleterCallback, indexedPropertyEnumerator<TestInterfac
      eImplementation>); |  1699     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); |  1700     functionTemplate->InstanceTemplate()->SetNamedPropertyHandler(TestInterfaceI
      mplementationV8Internal::namedPropertyGetterCallback, TestInterfaceImplementatio
      nV8Internal::namedPropertySetterCallback, TestInterfaceImplementationV8Internal:
      :namedPropertyQueryCallback, TestInterfaceImplementationV8Internal::namedPropert
      yDeleterCallback, TestInterfaceImplementationV8Internal::namedPropertyEnumerator
      Callback); | 
 |  1701     static const V8DOMConfiguration::SymbolKeyedMethodConfiguration symbolKeyedI
      teratorConfiguration = { v8::Symbol::GetIterator, TestInterfaceImplementationV8I
      nternal::iteratorMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScripts }
      ; | 
 |  1702     V8DOMConfiguration::installMethod(prototypeTemplate, defaultSignature, v8::D
      ontDelete, symbolKeyedIteratorConfiguration, isolate); | 
|  1679     functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
      ce::legacyCallCustom); |  1703     functionTemplate->InstanceTemplate()->SetCallAsFunctionHandler(V8TestInterfa
      ce::legacyCallCustom); | 
|  1680     static const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMeth
      odMethodConfiguration = { |  1704     static const V8DOMConfiguration::MethodConfiguration alwaysExposedStaticMeth
      odMethodConfiguration = { | 
|  1681         "alwaysExposedStaticMethod", TestInterfaceImplementationV8Internal::alwa
      ysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScrip
      ts, |  1705         "alwaysExposedStaticMethod", TestInterfaceImplementationV8Internal::alwa
      ysExposedStaticMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScrip
      ts, | 
|  1682     }; |  1706     }; | 
|  1683     V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>
      (), v8::None, alwaysExposedStaticMethodMethodConfiguration, isolate); |  1707     V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>
      (), v8::None, alwaysExposedStaticMethodMethodConfiguration, isolate); | 
|  1684     static const V8DOMConfiguration::MethodConfiguration implementsStaticVoidMet
      hodMethodConfiguration = { |  1708     static const V8DOMConfiguration::MethodConfiguration implementsStaticVoidMet
      hodMethodConfiguration = { | 
|  1685         "implementsStaticVoidMethod", TestInterfaceImplementationV8Internal::imp
      lementsStaticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScr
      ipts, |  1709         "implementsStaticVoidMethod", TestInterfaceImplementationV8Internal::imp
      lementsStaticVoidMethodMethodCallback, 0, 0, V8DOMConfiguration::ExposedToAllScr
      ipts, | 
|  1686     }; |  1710     }; | 
|  1687     V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>
      (), v8::None, implementsStaticVoidMethodMethodConfiguration, isolate); |  1711     V8DOMConfiguration::installMethod(functionTemplate, v8::Local<v8::Signature>
      (), v8::None, implementsStaticVoidMethodMethodConfiguration, isolate); | 
|  1688     if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) { |  1712     if (RuntimeEnabledFeatures::implements2FeatureNameEnabled()) { | 
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  1951             RELEASE_ASSERT_NOT_REACHED(); |  1975             RELEASE_ASSERT_NOT_REACHED(); | 
|  1952         } |  1976         } | 
|  1953         block.ReThrow(); |  1977         block.ReThrow(); | 
|  1954         return false; |  1978         return false; | 
|  1955     } |  1979     } | 
|  1956     return true; |  1980     return true; | 
|  1957 } |  1981 } | 
|  1958  |  1982  | 
|  1959 } // namespace blink |  1983 } // namespace blink | 
|  1960 #endif // ENABLE(CONDITION) |  1984 #endif // ENABLE(CONDITION) | 
| OLD | NEW |