OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 1534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1545 static void callWithExecutionContextAnyAttributeAttributeSetterCallback(v8::Loca
l<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void
>& info) | 1545 static void callWithExecutionContextAnyAttributeAttributeSetterCallback(v8::Loca
l<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void
>& info) |
1546 { | 1546 { |
1547 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1547 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1548 TestObjectPythonV8Internal::callWithExecutionContextAnyAttributeAttributeSet
ter(jsValue, info); | 1548 TestObjectPythonV8Internal::callWithExecutionContextAnyAttributeAttributeSet
ter(jsValue, info); |
1549 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1549 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1550 } | 1550 } |
1551 | 1551 |
1552 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(const v
8::PropertyCallbackInfo<v8::Value>& info) | 1552 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetter(const v
8::PropertyCallbackInfo<v8::Value>& info) |
1553 { | 1553 { |
1554 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 1554 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
1555 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 1555 ExceptionState exceptionState(ExceptionState::GetterContext, "checkSecurityF
orNodeReadonlyDocumentAttribute", "TestObjectPython" ,info.Holder(), info.GetIso
late()); |
1556 if (!BindingSecurity::shouldAllowAccessToNode(imp->checkSecurityForNodeReado
nlyDocumentAttribute(), exceptionState)) { | 1556 if (!BindingSecurity::shouldAllowAccessToNode(imp->checkSecurityForNodeReado
nlyDocumentAttribute(), exceptionState)) { |
1557 v8SetReturnValueNull(info); | 1557 v8SetReturnValueNull(info); |
1558 exceptionState.throwIfNeeded(); | 1558 exceptionState.throwIfNeeded(); |
1559 return; | 1559 return; |
1560 } | 1560 } |
1561 v8SetReturnValueFast(info, imp->checkSecurityForNodeReadonlyDocumentAttribut
e(), imp); | 1561 v8SetReturnValueFast(info, imp->checkSecurityForNodeReadonlyDocumentAttribut
e(), imp); |
1562 } | 1562 } |
1563 | 1563 |
1564 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback
(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1564 static void checkSecurityForNodeReadonlyDocumentAttributeAttributeGetterCallback
(v8::Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1565 { | 1565 { |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1846 { | 1846 { |
1847 v8::Local<v8::Value> jsValue = info[0]; | 1847 v8::Local<v8::Value> jsValue = info[0]; |
1848 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 1848 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
1849 TestObjectPythonV8Internal::exposeJSAccessorsLongAttributeAttributeSetter(js
Value, info); | 1849 TestObjectPythonV8Internal::exposeJSAccessorsLongAttributeAttributeSetter(js
Value, info); |
1850 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 1850 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
1851 } | 1851 } |
1852 | 1852 |
1853 static void getterRaisesExceptionLongAttributeAttributeGetter(const v8::Property
CallbackInfo<v8::Value>& info) | 1853 static void getterRaisesExceptionLongAttributeAttributeGetter(const v8::Property
CallbackInfo<v8::Value>& info) |
1854 { | 1854 { |
1855 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 1855 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
1856 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 1856 ExceptionState exceptionState(ExceptionState::GetterContext, "getterRaisesEx
ceptionLongAttribute", "TestObjectPython" ,info.Holder(), info.GetIsolate()); |
1857 int jsValue = imp->getterRaisesExceptionLongAttribute(exceptionState); | 1857 int jsValue = imp->getterRaisesExceptionLongAttribute(exceptionState); |
1858 if (UNLIKELY(exceptionState.throwIfNeeded())) | 1858 if (UNLIKELY(exceptionState.throwIfNeeded())) |
1859 return; | 1859 return; |
1860 v8SetReturnValueInt(info, jsValue); | 1860 v8SetReturnValueInt(info, jsValue); |
1861 } | 1861 } |
1862 | 1862 |
1863 static void getterRaisesExceptionLongAttributeAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 1863 static void getterRaisesExceptionLongAttributeAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
1864 { | 1864 { |
1865 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 1865 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
1866 TestObjectPythonV8Internal::getterRaisesExceptionLongAttributeAttributeGette
r(info); | 1866 TestObjectPythonV8Internal::getterRaisesExceptionLongAttributeAttributeGette
r(info); |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2371 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeA
ttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) | 2371 static void activityLoggingGetterForIsolatedWorldsPerWorldBindingsLongAttributeA
ttributeSetterCallbackForMainWorld(v8::Local<v8::String>, v8::Local<v8::Value> j
sValue, const v8::PropertyCallbackInfo<void>& info) |
2372 { | 2372 { |
2373 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2373 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2374 TestObjectPythonV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBi
ndingsLongAttributeAttributeSetterForMainWorld(jsValue, info); | 2374 TestObjectPythonV8Internal::activityLoggingGetterForIsolatedWorldsPerWorldBi
ndingsLongAttributeAttributeSetterForMainWorld(jsValue, info); |
2375 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2375 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2376 } | 2376 } |
2377 | 2377 |
2378 static void raisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallba
ckInfo<v8::Value>& info) | 2378 static void raisesExceptionLongAttributeAttributeGetter(const v8::PropertyCallba
ckInfo<v8::Value>& info) |
2379 { | 2379 { |
2380 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 2380 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
2381 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | 2381 ExceptionState exceptionState(ExceptionState::GetterContext, "raisesExceptio
nLongAttribute", "TestObjectPython" ,info.Holder(), info.GetIsolate()); |
2382 int jsValue = imp->raisesExceptionLongAttribute(exceptionState); | 2382 int jsValue = imp->raisesExceptionLongAttribute(exceptionState); |
2383 if (UNLIKELY(exceptionState.throwIfNeeded())) | 2383 if (UNLIKELY(exceptionState.throwIfNeeded())) |
2384 return; | 2384 return; |
2385 v8SetReturnValueInt(info, jsValue); | 2385 v8SetReturnValueInt(info, jsValue); |
2386 } | 2386 } |
2387 | 2387 |
2388 static void raisesExceptionLongAttributeAttributeGetterCallback(v8::Local<v8::St
ring>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2388 static void raisesExceptionLongAttributeAttributeGetterCallback(v8::Local<v8::St
ring>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2389 { | 2389 { |
2390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2390 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2391 TestObjectPythonV8Internal::raisesExceptionLongAttributeAttributeGetter(info
); | 2391 TestObjectPythonV8Internal::raisesExceptionLongAttributeAttributeGetter(info
); |
2392 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2392 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2393 } | 2393 } |
2394 | 2394 |
2395 static void raisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> jsV
alue, const v8::PropertyCallbackInfo<void>& info) | 2395 static void raisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Value> jsV
alue, const v8::PropertyCallbackInfo<void>& info) |
2396 { | 2396 { |
| 2397 ExceptionState exceptionState(ExceptionState::SetterContext, "raisesExceptio
nLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate()); |
2397 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 2398 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
2398 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); | 2399 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
2399 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
2400 imp->setRaisesExceptionLongAttribute(cppValue, exceptionState); | 2400 imp->setRaisesExceptionLongAttribute(cppValue, exceptionState); |
2401 exceptionState.throwIfNeeded(); | 2401 exceptionState.throwIfNeeded(); |
2402 } | 2402 } |
2403 | 2403 |
2404 static void raisesExceptionLongAttributeAttributeSetterCallback(v8::Local<v8::St
ring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2404 static void raisesExceptionLongAttributeAttributeSetterCallback(v8::Local<v8::St
ring>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2405 { | 2405 { |
2406 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2406 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2407 TestObjectPythonV8Internal::raisesExceptionLongAttributeAttributeSetter(jsVa
lue, info); | 2407 TestObjectPythonV8Internal::raisesExceptionLongAttributeAttributeSetter(jsVa
lue, info); |
2408 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2408 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2409 } | 2409 } |
(...skipping 456 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2866 | 2866 |
2867 static void setterRaisesExceptionLongAttributeAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2867 static void setterRaisesExceptionLongAttributeAttributeGetterCallback(v8::Local<
v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2868 { | 2868 { |
2869 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2869 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2870 TestObjectPythonV8Internal::setterRaisesExceptionLongAttributeAttributeGette
r(info); | 2870 TestObjectPythonV8Internal::setterRaisesExceptionLongAttributeAttributeGette
r(info); |
2871 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2871 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2872 } | 2872 } |
2873 | 2873 |
2874 static void setterRaisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Valu
e> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2874 static void setterRaisesExceptionLongAttributeAttributeSetter(v8::Local<v8::Valu
e> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2875 { | 2875 { |
| 2876 ExceptionState exceptionState(ExceptionState::SetterContext, "setterRaisesEx
ceptionLongAttribute", "TestObjectPython", info.Holder(), info.GetIsolate()); |
2876 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 2877 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
2877 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); | 2878 V8TRYCATCH_VOID(int, cppValue, toInt32(jsValue)); |
2878 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
2879 imp->setSetterRaisesExceptionLongAttribute(cppValue, exceptionState); | 2879 imp->setSetterRaisesExceptionLongAttribute(cppValue, exceptionState); |
2880 exceptionState.throwIfNeeded(); | 2880 exceptionState.throwIfNeeded(); |
2881 } | 2881 } |
2882 | 2882 |
2883 static void setterRaisesExceptionLongAttributeAttributeSetterCallback(v8::Local<
v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) | 2883 static void setterRaisesExceptionLongAttributeAttributeSetterCallback(v8::Local<
v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>&
info) |
2884 { | 2884 { |
2885 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2885 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2886 TestObjectPythonV8Internal::setterRaisesExceptionLongAttributeAttributeSette
r(jsValue, info); | 2886 TestObjectPythonV8Internal::setterRaisesExceptionLongAttributeAttributeSette
r(jsValue, info); |
2887 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2887 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2888 } | 2888 } |
2889 | 2889 |
2890 static void strictTypeCheckingFloatAttributeAttributeGetter(const v8::PropertyCa
llbackInfo<v8::Value>& info) | 2890 static void strictTypeCheckingFloatAttributeAttributeGetter(const v8::PropertyCa
llbackInfo<v8::Value>& info) |
2891 { | 2891 { |
2892 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 2892 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
2893 v8SetReturnValue(info, imp->strictTypeCheckingFloatAttribute()); | 2893 v8SetReturnValue(info, imp->strictTypeCheckingFloatAttribute()); |
2894 } | 2894 } |
2895 | 2895 |
2896 static void strictTypeCheckingFloatAttributeAttributeGetterCallback(v8::Local<v8
::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2896 static void strictTypeCheckingFloatAttributeAttributeGetterCallback(v8::Local<v8
::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2897 { | 2897 { |
2898 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2898 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2899 TestObjectPythonV8Internal::strictTypeCheckingFloatAttributeAttributeGetter(
info); | 2899 TestObjectPythonV8Internal::strictTypeCheckingFloatAttributeAttributeGetter(
info); |
2900 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2900 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2901 } | 2901 } |
2902 | 2902 |
2903 static void strictTypeCheckingFloatAttributeAttributeSetter(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) | 2903 static void strictTypeCheckingFloatAttributeAttributeSetter(v8::Local<v8::Value>
jsValue, const v8::PropertyCallbackInfo<void>& info) |
2904 { | 2904 { |
| 2905 ExceptionState exceptionState(ExceptionState::SetterContext, "strictTypeChec
kingFloatAttribute", "TestObjectPython", info.Holder(), info.GetIsolate()); |
2905 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 2906 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
2906 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()))
; | 2907 V8TRYCATCH_VOID(float, cppValue, static_cast<float>(jsValue->NumberValue()))
; |
2907 imp->setStrictTypeCheckingFloatAttribute(cppValue); | 2908 imp->setStrictTypeCheckingFloatAttribute(cppValue); |
2908 } | 2909 } |
2909 | 2910 |
2910 static void strictTypeCheckingFloatAttributeAttributeSetterCallback(v8::Local<v8
::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& i
nfo) | 2911 static void strictTypeCheckingFloatAttributeAttributeSetterCallback(v8::Local<v8
::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<void>& i
nfo) |
2911 { | 2912 { |
2912 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2913 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
2913 TestObjectPythonV8Internal::strictTypeCheckingFloatAttributeAttributeSetter(
jsValue, info); | 2914 TestObjectPythonV8Internal::strictTypeCheckingFloatAttributeAttributeSetter(
jsValue, info); |
2914 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2915 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2915 } | 2916 } |
2916 | 2917 |
2917 static void strictTypeCheckingTestInterfaceAttributeAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) | 2918 static void strictTypeCheckingTestInterfaceAttributeAttributeGetter(const v8::Pr
opertyCallbackInfo<v8::Value>& info) |
2918 { | 2919 { |
2919 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 2920 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
2920 v8SetReturnValueFast(info, imp->strictTypeCheckingTestInterfaceAttribute(),
imp); | 2921 v8SetReturnValueFast(info, imp->strictTypeCheckingTestInterfaceAttribute(),
imp); |
2921 } | 2922 } |
2922 | 2923 |
2923 static void strictTypeCheckingTestInterfaceAttributeAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) | 2924 static void strictTypeCheckingTestInterfaceAttributeAttributeGetterCallback(v8::
Local<v8::String>, const v8::PropertyCallbackInfo<v8::Value>& info) |
2924 { | 2925 { |
2925 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); | 2926 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMGetter"); |
2926 TestObjectPythonV8Internal::strictTypeCheckingTestInterfaceAttributeAttribut
eGetter(info); | 2927 TestObjectPythonV8Internal::strictTypeCheckingTestInterfaceAttributeAttribut
eGetter(info); |
2927 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 2928 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
2928 } | 2929 } |
2929 | 2930 |
2930 static void strictTypeCheckingTestInterfaceAttributeAttributeSetter(v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) | 2931 static void strictTypeCheckingTestInterfaceAttributeAttributeSetter(v8::Local<v8
::Value> jsValue, const v8::PropertyCallbackInfo<void>& info) |
2931 { | 2932 { |
| 2933 ExceptionState exceptionState(ExceptionState::SetterContext, "strictTypeChec
kingTestInterfaceAttribute", "TestObjectPython", info.Holder(), info.GetIsolate(
)); |
2932 if (!isUndefinedOrNull(jsValue) && !V8TestInterface::hasInstance(jsValue, in
fo.GetIsolate(), worldType(info.GetIsolate()))) { | 2934 if (!isUndefinedOrNull(jsValue) && !V8TestInterface::hasInstance(jsValue, in
fo.GetIsolate(), worldType(info.GetIsolate()))) { |
2933 throwTypeError(ExceptionMessages::failedToSet("strictTypeCheckingTestInt
erfaceAttribute", "TestObjectPython", "The provided value is not of type 'TestIn
terface'."), info.GetIsolate()); | 2935 exceptionState.throwTypeError("The provided value is not of type 'TestIn
terface'."); |
| 2936 exceptionState.throwIfNeeded(); |
2934 return; | 2937 return; |
2935 } | 2938 } |
2936 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 2939 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
2937 V8TRYCATCH_VOID(TestInterface*, cppValue, V8TestInterface::hasInstance(jsVal
ue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestInterface::toNative
(v8::Handle<v8::Object>::Cast(jsValue)) : 0); | 2940 V8TRYCATCH_VOID(TestInterface*, cppValue, V8TestInterface::hasInstance(jsVal
ue, info.GetIsolate(), worldType(info.GetIsolate())) ? V8TestInterface::toNative
(v8::Handle<v8::Object>::Cast(jsValue)) : 0); |
2938 imp->setStrictTypeCheckingTestInterfaceAttribute(WTF::getPtr(cppValue)); | 2941 imp->setStrictTypeCheckingTestInterfaceAttribute(WTF::getPtr(cppValue)); |
2939 } | 2942 } |
2940 | 2943 |
2941 static void strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<
void>& info) | 2944 static void strictTypeCheckingTestInterfaceAttributeAttributeSetterCallback(v8::
Local<v8::String>, v8::Local<v8::Value> jsValue, const v8::PropertyCallbackInfo<
void>& info) |
2942 { | 2945 { |
2943 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); | 2946 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMSetter"); |
(...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5130 | 5133 |
5131 static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) | 5134 static void overloadedStaticMethodMethodCallback(const v8::FunctionCallbackInfo<
v8::Value>& info) |
5132 { | 5135 { |
5133 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5136 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5134 TestObjectPythonV8Internal::overloadedStaticMethodMethod(info); | 5137 TestObjectPythonV8Internal::overloadedStaticMethodMethod(info); |
5135 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5138 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
5136 } | 5139 } |
5137 | 5140 |
5138 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) | 5141 static void addEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>& in
fo) |
5139 { | 5142 { |
| 5143 ExceptionState exceptionState(ExceptionState::ExecutionContext, "addEventLis
tener", "TestObjectPython", info.Holder(), info.GetIsolate()); |
5140 EventTarget* impl = V8TestObjectPython::toNative(info.Holder()); | 5144 EventTarget* impl = V8TestObjectPython::toNative(info.Holder()); |
5141 if (DOMWindow* window = impl->toDOMWindow()) { | 5145 if (DOMWindow* window = impl->toDOMWindow()) { |
5142 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
5143 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { | 5146 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { |
5144 exceptionState.throwIfNeeded(); | 5147 exceptionState.throwIfNeeded(); |
5145 return; | 5148 return; |
5146 } | 5149 } |
5147 if (!window->document()) | 5150 if (!window->document()) |
5148 return; | 5151 return; |
5149 } | 5152 } |
5150 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOrCreate); | 5153 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOrCreate); |
5151 if (listener) { | 5154 if (listener) { |
5152 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); | 5155 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); |
5153 impl->addEventListener(eventName, listener, info[2]->BooleanValue()); | 5156 impl->addEventListener(eventName, listener, info[2]->BooleanValue()); |
5154 if (!impl->toNode()) | 5157 if (!impl->toNode()) |
5155 createHiddenDependency(info.Holder(), info[1], V8TestObjectPython::e
ventListenerCacheIndex, info.GetIsolate()); | 5158 createHiddenDependency(info.Holder(), info[1], V8TestObjectPython::e
ventListenerCacheIndex, info.GetIsolate()); |
5156 } | 5159 } |
5157 } | 5160 } |
5158 | 5161 |
5159 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) | 5162 static void addEventListenerMethodCallback(const v8::FunctionCallbackInfo<v8::Va
lue>& info) |
5160 { | 5163 { |
5161 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5164 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5162 TestObjectPythonV8Internal::addEventListenerMethod(info); | 5165 TestObjectPythonV8Internal::addEventListenerMethod(info); |
5163 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5166 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
5164 } | 5167 } |
5165 | 5168 |
5166 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) | 5169 static void removeEventListenerMethod(const v8::FunctionCallbackInfo<v8::Value>&
info) |
5167 { | 5170 { |
| 5171 ExceptionState exceptionState(ExceptionState::ExecutionContext, "removeEvent
Listener", "TestObjectPython", info.Holder(), info.GetIsolate()); |
5168 EventTarget* impl = V8TestObjectPython::toNative(info.Holder()); | 5172 EventTarget* impl = V8TestObjectPython::toNative(info.Holder()); |
5169 if (DOMWindow* window = impl->toDOMWindow()) { | 5173 if (DOMWindow* window = impl->toDOMWindow()) { |
5170 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
5171 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { | 5174 if (!BindingSecurity::shouldAllowAccessToFrame(window->frame(), exceptio
nState)) { |
5172 exceptionState.throwIfNeeded(); | 5175 exceptionState.throwIfNeeded(); |
5173 return; | 5176 return; |
5174 } | 5177 } |
5175 if (!window->document()) | 5178 if (!window->document()) |
5176 return; | 5179 return; |
5177 } | 5180 } |
5178 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOnly); | 5181 RefPtr<EventListener> listener = V8EventListenerList::getEventListener(info[
1], false, ListenerFindOnly); |
5179 if (listener) { | 5182 if (listener) { |
5180 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); | 5183 V8TRYCATCH_FOR_V8STRINGRESOURCE_VOID(V8StringResource<WithNullCheck>, ev
entName, info[0]); |
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5838 | 5841 |
5839 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMain
World(const v8::FunctionCallbackInfo<v8::Value>& info) | 5842 static void perWorldBindingsVoidMethodTestInterfaceEmptyArgMethodCallbackForMain
World(const v8::FunctionCallbackInfo<v8::Value>& info) |
5840 { | 5843 { |
5841 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5844 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5842 TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgM
ethodForMainWorld(info); | 5845 TestObjectPythonV8Internal::perWorldBindingsVoidMethodTestInterfaceEmptyArgM
ethodForMainWorld(info); |
5843 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5846 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
5844 } | 5847 } |
5845 | 5848 |
5846 static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) | 5849 static void raisesExceptionVoidMethodMethod(const v8::FunctionCallbackInfo<v8::V
alue>& info) |
5847 { | 5850 { |
| 5851 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExcep
tionVoidMethod", "TestObjectPython", info.Holder(), info.GetIsolate()); |
5848 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 5852 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
5849 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
5850 imp->raisesExceptionVoidMethod(exceptionState); | 5853 imp->raisesExceptionVoidMethod(exceptionState); |
5851 if (exceptionState.throwIfNeeded()) | 5854 if (exceptionState.throwIfNeeded()) |
5852 return; | 5855 return; |
5853 } | 5856 } |
5854 | 5857 |
5855 static void raisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackIn
fo<v8::Value>& info) | 5858 static void raisesExceptionVoidMethodMethodCallback(const v8::FunctionCallbackIn
fo<v8::Value>& info) |
5856 { | 5859 { |
5857 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); | 5860 TRACE_EVENT_SET_SAMPLING_STATE("Blink", "DOMMethod"); |
5858 TestObjectPythonV8Internal::raisesExceptionVoidMethodMethod(info); | 5861 TestObjectPythonV8Internal::raisesExceptionVoidMethodMethod(info); |
5859 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); | 5862 TRACE_EVENT_SET_SAMPLING_STATE("V8", "Execution"); |
5860 } | 5863 } |
5861 | 5864 |
5862 static void raisesExceptionVoidMethodOptionalLongArgMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) | 5865 static void raisesExceptionVoidMethodOptionalLongArgMethod(const v8::FunctionCal
lbackInfo<v8::Value>& info) |
5863 { | 5866 { |
| 5867 ExceptionState exceptionState(ExceptionState::ExecutionContext, "raisesExcep
tionVoidMethodOptionalLongArg", "TestObjectPython", info.Holder(), info.GetIsola
te()); |
5864 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); | 5868 TestObjectPython* imp = V8TestObjectPython::toNative(info.Holder()); |
5865 ExceptionState exceptionState(info.Holder(), info.GetIsolate()); | |
5866 if (UNLIKELY(info.Length() <= 0)) { | 5869 if (UNLIKELY(info.Length() <= 0)) { |
5867 imp->raisesExceptionVoidMethodOptionalLongArg(exceptionState); | 5870 imp->raisesExceptionVoidMethodOptionalLongArg(exceptionState); |
5868 if (exceptionState.throwIfNeeded()) | 5871 if (exceptionState.throwIfNeeded()) |
5869 return; | 5872 return; |
5870 return; | 5873 return; |
5871 } | 5874 } |
5872 V8TRYCATCH_VOID(int, optionalLongArg, toInt32(info[0])); | 5875 V8TRYCATCH_VOID(int, optionalLongArg, toInt32(info[0])); |
5873 imp->raisesExceptionVoidMethodOptionalLongArg(optionalLongArg, exceptionStat
e); | 5876 imp->raisesExceptionVoidMethodOptionalLongArg(optionalLongArg, exceptionStat
e); |
5874 if (exceptionState.throwIfNeeded()) | 5877 if (exceptionState.throwIfNeeded()) |
5875 return; | 5878 return; |
(...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6538 fromInternalPointer(object)->deref(); | 6541 fromInternalPointer(object)->deref(); |
6539 } | 6542 } |
6540 | 6543 |
6541 template<> | 6544 template<> |
6542 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) | 6545 v8::Handle<v8::Value> toV8NoInline(TestObjectPython* impl, v8::Handle<v8::Object
> creationContext, v8::Isolate* isolate) |
6543 { | 6546 { |
6544 return toV8(impl, creationContext, isolate); | 6547 return toV8(impl, creationContext, isolate); |
6545 } | 6548 } |
6546 | 6549 |
6547 } // namespace WebCore | 6550 } // namespace WebCore |
OLD | NEW |