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 #include "V8TestObject.h" | 8 #include "V8TestObject.h" |
9 | 9 |
10 #include "bindings/core/v8/BindingSecurity.h" | 10 #include "bindings/core/v8/BindingSecurity.h" |
(...skipping 10733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10744 ScriptState* scriptState = ScriptState::from(context); | 10744 ScriptState* scriptState = ScriptState::from(context); |
10745 if (!scriptState->executionContext()) | 10745 if (!scriptState->executionContext()) |
10746 return false; | 10746 return false; |
10747 | 10747 |
10748 ScriptState::Scope scope(scriptState); | 10748 ScriptState::Scope scope(scriptState); |
10749 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10749 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10750 | 10750 |
10751 v8::Handle<v8::Value> *argv = 0; | 10751 v8::Handle<v8::Value> *argv = 0; |
10752 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); | 10752 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); |
10753 v8::TryCatch block; | 10753 v8::TryCatch block; |
10754 V8RethrowTryCatchScope rethrow(block); | |
10755 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl
ementedInPrivateScript", holder, 0, argv); | 10754 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl
ementedInPrivateScript", holder, 0, argv); |
10756 if (block.HasCaught()) { | 10755 if (block.HasCaught()) { |
10757 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10756 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10758 // FIXME: We should support more exceptions. | 10757 // FIXME: We should support more exceptions. |
10759 RELEASE_ASSERT_NOT_REACHED(); | 10758 RELEASE_ASSERT_NOT_REACHED(); |
10760 } | 10759 } |
| 10760 block.ReThrow(); |
10761 return false; | 10761 return false; |
10762 } | 10762 } |
10763 return true; | 10763 return true; |
10764 } | 10764 } |
10765 | 10765 |
10766 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
calFrame* frame, TestObject* holderImpl, int* result) | 10766 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
calFrame* frame, TestObject* holderImpl, int* result) |
10767 { | 10767 { |
10768 if (!frame) | 10768 if (!frame) |
10769 return false; | 10769 return false; |
10770 v8::HandleScope handleScope(toIsolate(frame)); | 10770 v8::HandleScope handleScope(toIsolate(frame)); |
10771 ScriptForbiddenScope::AllowUserAgentScript script; | 10771 ScriptForbiddenScope::AllowUserAgentScript script; |
10772 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10772 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10773 if (context.IsEmpty()) | 10773 if (context.IsEmpty()) |
10774 return false; | 10774 return false; |
10775 ScriptState* scriptState = ScriptState::from(context); | 10775 ScriptState* scriptState = ScriptState::from(context); |
10776 if (!scriptState->executionContext()) | 10776 if (!scriptState->executionContext()) |
10777 return false; | 10777 return false; |
10778 | 10778 |
10779 ScriptState::Scope scope(scriptState); | 10779 ScriptState::Scope scope(scriptState); |
10780 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10780 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10781 | 10781 |
10782 v8::Handle<v8::Value> *argv = 0; | 10782 v8::Handle<v8::Value> *argv = 0; |
10783 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr
iptState->isolate()); | 10783 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr
iptState->isolate()); |
10784 v8::TryCatch block; | 10784 v8::TryCatch block; |
10785 V8RethrowTryCatchScope rethrow(block); | |
10786 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); | 10785 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); |
10787 if (block.HasCaught()) { | 10786 if (block.HasCaught()) { |
10788 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10787 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10789 // FIXME: We should support more exceptions. | 10788 // FIXME: We should support more exceptions. |
10790 RELEASE_ASSERT_NOT_REACHED(); | 10789 RELEASE_ASSERT_NOT_REACHED(); |
10791 } | 10790 } |
| 10791 block.ReThrow(); |
10792 return false; | 10792 return false; |
10793 } | 10793 } |
10794 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10794 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10795 RELEASE_ASSERT(!exceptionState.hadException()); | 10795 RELEASE_ASSERT(!exceptionState.hadException()); |
10796 *result = cppValue; | 10796 *result = cppValue; |
10797 return true; | 10797 return true; |
10798 } | 10798 } |
10799 | 10799 |
10800 bool V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPriva
teScriptMethod(LocalFrame* frame, TestObject* holderImpl, int value, int* result
) | 10800 bool V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPriva
teScriptMethod(LocalFrame* frame, TestObject* holderImpl, int value, int* result
) |
10801 { | 10801 { |
10802 if (!frame) | 10802 if (!frame) |
10803 return false; | 10803 return false; |
10804 v8::HandleScope handleScope(toIsolate(frame)); | 10804 v8::HandleScope handleScope(toIsolate(frame)); |
10805 ScriptForbiddenScope::AllowUserAgentScript script; | 10805 ScriptForbiddenScope::AllowUserAgentScript script; |
10806 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10806 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10807 if (context.IsEmpty()) | 10807 if (context.IsEmpty()) |
10808 return false; | 10808 return false; |
10809 ScriptState* scriptState = ScriptState::from(context); | 10809 ScriptState* scriptState = ScriptState::from(context); |
10810 if (!scriptState->executionContext()) | 10810 if (!scriptState->executionContext()) |
10811 return false; | 10811 return false; |
10812 | 10812 |
10813 ScriptState::Scope scope(scriptState); | 10813 ScriptState::Scope scope(scriptState); |
10814 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10814 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10815 | 10815 |
10816 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); | 10816 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); |
10817 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10817 v8::Handle<v8::Value> argv[] = { valueHandle }; |
10818 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context
()->Global(), scriptState->isolate()); | 10818 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context
()->Global(), scriptState->isolate()); |
10819 v8::TryCatch block; | 10819 v8::TryCatch block; |
10820 V8RethrowTryCatchScope rethrow(block); | |
10821 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde
r, 1, argv); | 10820 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde
r, 1, argv); |
10822 if (block.HasCaught()) { | 10821 if (block.HasCaught()) { |
10823 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10822 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10824 // FIXME: We should support more exceptions. | 10823 // FIXME: We should support more exceptions. |
10825 RELEASE_ASSERT_NOT_REACHED(); | 10824 RELEASE_ASSERT_NOT_REACHED(); |
10826 } | 10825 } |
| 10826 block.ReThrow(); |
10827 return false; | 10827 return false; |
10828 } | 10828 } |
10829 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10829 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10830 RELEASE_ASSERT(!exceptionState.hadException()); | 10830 RELEASE_ASSERT(!exceptionState.hadException()); |
10831 *result = cppValue; | 10831 *result = cppValue; |
10832 return true; | 10832 return true; |
10833 } | 10833 } |
10834 | 10834 |
10835 bool V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPri
vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, String value, String
* result) | 10835 bool V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPri
vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, String value, String
* result) |
10836 { | 10836 { |
10837 if (!frame) | 10837 if (!frame) |
10838 return false; | 10838 return false; |
10839 v8::HandleScope handleScope(toIsolate(frame)); | 10839 v8::HandleScope handleScope(toIsolate(frame)); |
10840 ScriptForbiddenScope::AllowUserAgentScript script; | 10840 ScriptForbiddenScope::AllowUserAgentScript script; |
10841 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10841 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10842 if (context.IsEmpty()) | 10842 if (context.IsEmpty()) |
10843 return false; | 10843 return false; |
10844 ScriptState* scriptState = ScriptState::from(context); | 10844 ScriptState* scriptState = ScriptState::from(context); |
10845 if (!scriptState->executionContext()) | 10845 if (!scriptState->executionContext()) |
10846 return false; | 10846 return false; |
10847 | 10847 |
10848 ScriptState::Scope scope(scriptState); | 10848 ScriptState::Scope scope(scriptState); |
10849 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10849 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10850 | 10850 |
10851 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); | 10851 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); |
10852 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10852 v8::Handle<v8::Value> argv[] = { valueHandle }; |
10853 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho
dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); | 10853 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho
dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
10854 v8::TryCatch block; | 10854 v8::TryCatch block; |
10855 V8RethrowTryCatchScope rethrow(block); | |
10856 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol
der, 1, argv); | 10855 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol
der, 1, argv); |
10857 if (block.HasCaught()) { | 10856 if (block.HasCaught()) { |
10858 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10857 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10859 // FIXME: We should support more exceptions. | 10858 // FIXME: We should support more exceptions. |
10860 RELEASE_ASSERT_NOT_REACHED(); | 10859 RELEASE_ASSERT_NOT_REACHED(); |
10861 } | 10860 } |
| 10861 block.ReThrow(); |
10862 return false; | 10862 return false; |
10863 } | 10863 } |
10864 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 10864 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
10865 RELEASE_ASSERT(!exceptionState.hadException()); | 10865 RELEASE_ASSERT(!exceptionState.hadException()); |
10866 *result = cppValue; | 10866 *result = cppValue; |
10867 return true; | 10867 return true; |
10868 } | 10868 } |
10869 | 10869 |
10870 bool V8TestObject::PrivateScript::nodeMethodWithNodeArgumentImplementedInPrivate
ScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<N
ode> value, RefPtrWillBeRawPtr<Node>* result) | 10870 bool V8TestObject::PrivateScript::nodeMethodWithNodeArgumentImplementedInPrivate
ScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<N
ode> value, RefPtrWillBeRawPtr<Node>* result) |
10871 { | 10871 { |
10872 if (!frame) | 10872 if (!frame) |
10873 return false; | 10873 return false; |
10874 v8::HandleScope handleScope(toIsolate(frame)); | 10874 v8::HandleScope handleScope(toIsolate(frame)); |
10875 ScriptForbiddenScope::AllowUserAgentScript script; | 10875 ScriptForbiddenScope::AllowUserAgentScript script; |
10876 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10876 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10877 if (context.IsEmpty()) | 10877 if (context.IsEmpty()) |
10878 return false; | 10878 return false; |
10879 ScriptState* scriptState = ScriptState::from(context); | 10879 ScriptState* scriptState = ScriptState::from(context); |
10880 if (!scriptState->executionContext()) | 10880 if (!scriptState->executionContext()) |
10881 return false; | 10881 return false; |
10882 | 10882 |
10883 ScriptState::Scope scope(scriptState); | 10883 ScriptState::Scope scope(scriptState); |
10884 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10884 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10885 | 10885 |
10886 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob
al(), scriptState->isolate()); | 10886 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob
al(), scriptState->isolate()); |
10887 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10887 v8::Handle<v8::Value> argv[] = { valueHandle }; |
10888 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()
->Global(), scriptState->isolate()); | 10888 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()
->Global(), scriptState->isolate()); |
10889 v8::TryCatch block; | 10889 v8::TryCatch block; |
10890 V8RethrowTryCatchScope rethrow(block); | |
10891 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder,
1, argv); | 10890 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder,
1, argv); |
10892 if (block.HasCaught()) { | 10891 if (block.HasCaught()) { |
10893 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10892 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10894 // FIXME: We should support more exceptions. | 10893 // FIXME: We should support more exceptions. |
10895 RELEASE_ASSERT_NOT_REACHED(); | 10894 RELEASE_ASSERT_NOT_REACHED(); |
10896 } | 10895 } |
| 10896 block.ReThrow(); |
10897 return false; | 10897 return false; |
10898 } | 10898 } |
10899 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); | 10899 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); |
10900 RELEASE_ASSERT(!exceptionState.hadException()); | 10900 RELEASE_ASSERT(!exceptionState.hadException()); |
10901 *result = cppValue; | 10901 *result = cppValue; |
10902 return true; | 10902 return true; |
10903 } | 10903 } |
10904 | 10904 |
10905 bool V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPri
vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawP
tr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1, double val
ue2, String string, RefPtrWillBeRawPtr<Node>* result) | 10905 bool V8TestObject::PrivateScript::nodeMethodWithVariousArgumentsImplementedInPri
vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawP
tr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1, double val
ue2, String string, RefPtrWillBeRawPtr<Node>* result) |
10906 { | 10906 { |
(...skipping 12 matching lines...) Expand all Loading... |
10919 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10919 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10920 | 10920 |
10921 v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()
->Global(), scriptState->isolate()); | 10921 v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()
->Global(), scriptState->isolate()); |
10922 v8::Handle<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global
(), scriptState->isolate()); | 10922 v8::Handle<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global
(), scriptState->isolate()); |
10923 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); | 10923 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); |
10924 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(),
value2); | 10924 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(),
value2); |
10925 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string
); | 10925 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string
); |
10926 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v
alue2Handle, stringHandle }; | 10926 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v
alue2Handle, stringHandle }; |
10927 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); | 10927 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
10928 v8::TryCatch block; | 10928 v8::TryCatch block; |
10929 V8RethrowTryCatchScope rethrow(block); | |
10930 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol
der, 5, argv); | 10929 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol
der, 5, argv); |
10931 if (block.HasCaught()) { | 10930 if (block.HasCaught()) { |
10932 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10931 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10933 // FIXME: We should support more exceptions. | 10932 // FIXME: We should support more exceptions. |
10934 RELEASE_ASSERT_NOT_REACHED(); | 10933 RELEASE_ASSERT_NOT_REACHED(); |
10935 } | 10934 } |
| 10935 block.ReThrow(); |
10936 return false; | 10936 return false; |
10937 } | 10937 } |
10938 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); | 10938 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); |
10939 RELEASE_ASSERT(!exceptionState.hadException()); | 10939 RELEASE_ASSERT(!exceptionState.hadException()); |
10940 *result = cppValue; | 10940 *result = cppValue; |
10941 return true; | 10941 return true; |
10942 } | 10942 } |
10943 | 10943 |
10944 bool V8TestObject::PrivateScript::methodForPrivateScriptOnlyMethod(LocalFrame* f
rame, TestObject* holderImpl, int value1, int value2, int* result) | 10944 bool V8TestObject::PrivateScript::methodForPrivateScriptOnlyMethod(LocalFrame* f
rame, TestObject* holderImpl, int value1, int value2, int* result) |
10945 { | 10945 { |
10946 if (!frame) | 10946 if (!frame) |
10947 return false; | 10947 return false; |
10948 v8::HandleScope handleScope(toIsolate(frame)); | 10948 v8::HandleScope handleScope(toIsolate(frame)); |
10949 ScriptForbiddenScope::AllowUserAgentScript script; | 10949 ScriptForbiddenScope::AllowUserAgentScript script; |
10950 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10950 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10951 if (context.IsEmpty()) | 10951 if (context.IsEmpty()) |
10952 return false; | 10952 return false; |
10953 ScriptState* scriptState = ScriptState::from(context); | 10953 ScriptState* scriptState = ScriptState::from(context); |
10954 if (!scriptState->executionContext()) | 10954 if (!scriptState->executionContext()) |
10955 return false; | 10955 return false; |
10956 | 10956 |
10957 ScriptState::Scope scope(scriptState); | 10957 ScriptState::Scope scope(scriptState); |
10958 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10958 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10959 | 10959 |
10960 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); | 10960 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); |
10961 v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate()
, value2); | 10961 v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate()
, value2); |
10962 v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle }; | 10962 v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle }; |
10963 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 10963 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
10964 v8::TryCatch block; | 10964 v8::TryCatch block; |
10965 V8RethrowTryCatchScope rethrow(block); | |
10966 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "methodForPrivateScriptOnly", holder, 2, argv); | 10965 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "methodForPrivateScriptOnly", holder, 2, argv); |
10967 if (block.HasCaught()) { | 10966 if (block.HasCaught()) { |
10968 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10967 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10969 // FIXME: We should support more exceptions. | 10968 // FIXME: We should support more exceptions. |
10970 RELEASE_ASSERT_NOT_REACHED(); | 10969 RELEASE_ASSERT_NOT_REACHED(); |
10971 } | 10970 } |
| 10971 block.ReThrow(); |
10972 return false; | 10972 return false; |
10973 } | 10973 } |
10974 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10974 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10975 RELEASE_ASSERT(!exceptionState.hadException()); | 10975 RELEASE_ASSERT(!exceptionState.hadException()); |
10976 *result = cppValue; | 10976 *result = cppValue; |
10977 return true; | 10977 return true; |
10978 } | 10978 } |
10979 | 10979 |
10980 bool V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(LocalFra
me* frame, TestObject* holderImpl, int* result) | 10980 bool V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(LocalFra
me* frame, TestObject* holderImpl, int* result) |
10981 { | 10981 { |
10982 if (!frame) | 10982 if (!frame) |
10983 return false; | 10983 return false; |
10984 v8::HandleScope handleScope(toIsolate(frame)); | 10984 v8::HandleScope handleScope(toIsolate(frame)); |
10985 ScriptForbiddenScope::AllowUserAgentScript script; | 10985 ScriptForbiddenScope::AllowUserAgentScript script; |
10986 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10986 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10987 if (context.IsEmpty()) | 10987 if (context.IsEmpty()) |
10988 return false; | 10988 return false; |
10989 ScriptState* scriptState = ScriptState::from(context); | 10989 ScriptState* scriptState = ScriptState::from(context); |
10990 if (!scriptState->executionContext()) | 10990 if (!scriptState->executionContext()) |
10991 return false; | 10991 return false; |
10992 | 10992 |
10993 ScriptState::Scope scope(scriptState); | 10993 ScriptState::Scope scope(scriptState); |
10994 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10994 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10995 | 10995 |
10996 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA
ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate(
)); | 10996 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA
ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate(
)); |
10997 v8::TryCatch block; | 10997 v8::TryCatch block; |
10998 V8RethrowTryCatchScope rethrow(block); | |
10999 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "readonlyShortAttribute", holder); | 10998 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "readonlyShortAttribute", holder); |
11000 if (block.HasCaught()) { | 10999 if (block.HasCaught()) { |
11001 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11000 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11002 // FIXME: We should support more exceptions. | 11001 // FIXME: We should support more exceptions. |
11003 RELEASE_ASSERT_NOT_REACHED(); | 11002 RELEASE_ASSERT_NOT_REACHED(); |
11004 } | 11003 } |
| 11004 block.ReThrow(); |
11005 return false; | 11005 return false; |
11006 } | 11006 } |
11007 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 11007 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
11008 RELEASE_ASSERT(!exceptionState.hadException()); | 11008 RELEASE_ASSERT(!exceptionState.hadException()); |
11009 *result = cppValue; | 11009 *result = cppValue; |
11010 return true; | 11010 return true; |
11011 } | 11011 } |
11012 | 11012 |
11013 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
e, TestObject* holderImpl, int* result) | 11013 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
e, TestObject* holderImpl, int* result) |
11014 { | 11014 { |
11015 if (!frame) | 11015 if (!frame) |
11016 return false; | 11016 return false; |
11017 v8::HandleScope handleScope(toIsolate(frame)); | 11017 v8::HandleScope handleScope(toIsolate(frame)); |
11018 ScriptForbiddenScope::AllowUserAgentScript script; | 11018 ScriptForbiddenScope::AllowUserAgentScript script; |
11019 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11019 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11020 if (context.IsEmpty()) | 11020 if (context.IsEmpty()) |
11021 return false; | 11021 return false; |
11022 ScriptState* scriptState = ScriptState::from(context); | 11022 ScriptState* scriptState = ScriptState::from(context); |
11023 if (!scriptState->executionContext()) | 11023 if (!scriptState->executionContext()) |
11024 return false; | 11024 return false; |
11025 | 11025 |
11026 ScriptState::Scope scope(scriptState); | 11026 ScriptState::Scope scope(scriptState); |
11027 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11027 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11028 | 11028 |
11029 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11029 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
11030 v8::TryCatch block; | 11030 v8::TryCatch block; |
11031 V8RethrowTryCatchScope rethrow(block); | |
11032 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "shortAttribute", holder); | 11031 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "shortAttribute", holder); |
11033 if (block.HasCaught()) { | 11032 if (block.HasCaught()) { |
11034 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11033 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11035 // FIXME: We should support more exceptions. | 11034 // FIXME: We should support more exceptions. |
11036 RELEASE_ASSERT_NOT_REACHED(); | 11035 RELEASE_ASSERT_NOT_REACHED(); |
11037 } | 11036 } |
| 11037 block.ReThrow(); |
11038 return false; | 11038 return false; |
11039 } | 11039 } |
11040 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 11040 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
11041 RELEASE_ASSERT(!exceptionState.hadException()); | 11041 RELEASE_ASSERT(!exceptionState.hadException()); |
11042 *result = cppValue; | 11042 *result = cppValue; |
11043 return true; | 11043 return true; |
11044 } | 11044 } |
11045 | 11045 |
11046 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram
e, TestObject* holderImpl, int cppValue) | 11046 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram
e, TestObject* holderImpl, int cppValue) |
11047 { | 11047 { |
11048 if (!frame) | 11048 if (!frame) |
11049 return false; | 11049 return false; |
11050 v8::HandleScope handleScope(toIsolate(frame)); | 11050 v8::HandleScope handleScope(toIsolate(frame)); |
11051 ScriptForbiddenScope::AllowUserAgentScript script; | 11051 ScriptForbiddenScope::AllowUserAgentScript script; |
11052 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11052 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11053 if (context.IsEmpty()) | 11053 if (context.IsEmpty()) |
11054 return false; | 11054 return false; |
11055 ScriptState* scriptState = ScriptState::from(context); | 11055 ScriptState* scriptState = ScriptState::from(context); |
11056 if (!scriptState->executionContext()) | 11056 if (!scriptState->executionContext()) |
11057 return false; | 11057 return false; |
11058 | 11058 |
11059 ScriptState::Scope scope(scriptState); | 11059 ScriptState::Scope scope(scriptState); |
11060 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11060 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11061 | 11061 |
11062 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11062 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
11063 v8::TryCatch block; | 11063 v8::TryCatch block; |
11064 V8RethrowTryCatchScope rethrow(block); | |
11065 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short
Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); | 11064 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short
Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); |
11066 if (block.HasCaught()) { | 11065 if (block.HasCaught()) { |
11067 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11066 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11068 // FIXME: We should support more exceptions. | 11067 // FIXME: We should support more exceptions. |
11069 RELEASE_ASSERT_NOT_REACHED(); | 11068 RELEASE_ASSERT_NOT_REACHED(); |
11070 } | 11069 } |
| 11070 block.ReThrow(); |
11071 return false; | 11071 return false; |
11072 } | 11072 } |
11073 return true; | 11073 return true; |
11074 } | 11074 } |
11075 | 11075 |
11076 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
me, TestObject* holderImpl, String* result) | 11076 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
me, TestObject* holderImpl, String* result) |
11077 { | 11077 { |
11078 if (!frame) | 11078 if (!frame) |
11079 return false; | 11079 return false; |
11080 v8::HandleScope handleScope(toIsolate(frame)); | 11080 v8::HandleScope handleScope(toIsolate(frame)); |
11081 ScriptForbiddenScope::AllowUserAgentScript script; | 11081 ScriptForbiddenScope::AllowUserAgentScript script; |
11082 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11082 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11083 if (context.IsEmpty()) | 11083 if (context.IsEmpty()) |
11084 return false; | 11084 return false; |
11085 ScriptState* scriptState = ScriptState::from(context); | 11085 ScriptState* scriptState = ScriptState::from(context); |
11086 if (!scriptState->executionContext()) | 11086 if (!scriptState->executionContext()) |
11087 return false; | 11087 return false; |
11088 | 11088 |
11089 ScriptState::Scope scope(scriptState); | 11089 ScriptState::Scope scope(scriptState); |
11090 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11090 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11091 | 11091 |
11092 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11092 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
11093 v8::TryCatch block; | 11093 v8::TryCatch block; |
11094 V8RethrowTryCatchScope rethrow(block); | |
11095 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "stringAttribute", holder); | 11094 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "stringAttribute", holder); |
11096 if (block.HasCaught()) { | 11095 if (block.HasCaught()) { |
11097 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11096 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11098 // FIXME: We should support more exceptions. | 11097 // FIXME: We should support more exceptions. |
11099 RELEASE_ASSERT_NOT_REACHED(); | 11098 RELEASE_ASSERT_NOT_REACHED(); |
11100 } | 11099 } |
| 11100 block.ReThrow(); |
11101 return false; | 11101 return false; |
11102 } | 11102 } |
11103 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 11103 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
11104 RELEASE_ASSERT(!exceptionState.hadException()); | 11104 RELEASE_ASSERT(!exceptionState.hadException()); |
11105 *result = cppValue; | 11105 *result = cppValue; |
11106 return true; | 11106 return true; |
11107 } | 11107 } |
11108 | 11108 |
11109 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra
me, TestObject* holderImpl, String cppValue) | 11109 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra
me, TestObject* holderImpl, String cppValue) |
11110 { | 11110 { |
11111 if (!frame) | 11111 if (!frame) |
11112 return false; | 11112 return false; |
11113 v8::HandleScope handleScope(toIsolate(frame)); | 11113 v8::HandleScope handleScope(toIsolate(frame)); |
11114 ScriptForbiddenScope::AllowUserAgentScript script; | 11114 ScriptForbiddenScope::AllowUserAgentScript script; |
11115 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11115 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11116 if (context.IsEmpty()) | 11116 if (context.IsEmpty()) |
11117 return false; | 11117 return false; |
11118 ScriptState* scriptState = ScriptState::from(context); | 11118 ScriptState* scriptState = ScriptState::from(context); |
11119 if (!scriptState->executionContext()) | 11119 if (!scriptState->executionContext()) |
11120 return false; | 11120 return false; |
11121 | 11121 |
11122 ScriptState::Scope scope(scriptState); | 11122 ScriptState::Scope scope(scriptState); |
11123 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11123 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11124 | 11124 |
11125 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11125 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
11126 v8::TryCatch block; | 11126 v8::TryCatch block; |
11127 V8RethrowTryCatchScope rethrow(block); | |
11128 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin
gAttribute", holder, v8String(scriptState->isolate(), cppValue)); | 11127 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin
gAttribute", holder, v8String(scriptState->isolate(), cppValue)); |
11129 if (block.HasCaught()) { | 11128 if (block.HasCaught()) { |
11130 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11129 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11131 // FIXME: We should support more exceptions. | 11130 // FIXME: We should support more exceptions. |
11132 RELEASE_ASSERT_NOT_REACHED(); | 11131 RELEASE_ASSERT_NOT_REACHED(); |
11133 } | 11132 } |
| 11133 block.ReThrow(); |
11134 return false; | 11134 return false; |
11135 } | 11135 } |
11136 return true; | 11136 return true; |
11137 } | 11137 } |
11138 | 11138 |
11139 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame
, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) | 11139 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame
, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) |
11140 { | 11140 { |
11141 if (!frame) | 11141 if (!frame) |
11142 return false; | 11142 return false; |
11143 v8::HandleScope handleScope(toIsolate(frame)); | 11143 v8::HandleScope handleScope(toIsolate(frame)); |
11144 ScriptForbiddenScope::AllowUserAgentScript script; | 11144 ScriptForbiddenScope::AllowUserAgentScript script; |
11145 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11145 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11146 if (context.IsEmpty()) | 11146 if (context.IsEmpty()) |
11147 return false; | 11147 return false; |
11148 ScriptState* scriptState = ScriptState::from(context); | 11148 ScriptState* scriptState = ScriptState::from(context); |
11149 if (!scriptState->executionContext()) | 11149 if (!scriptState->executionContext()) |
11150 return false; | 11150 return false; |
11151 | 11151 |
11152 ScriptState::Scope scope(scriptState); | 11152 ScriptState::Scope scope(scriptState); |
11153 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11153 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11154 | 11154 |
11155 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11155 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
11156 v8::TryCatch block; | 11156 v8::TryCatch block; |
11157 V8RethrowTryCatchScope rethrow(block); | |
11158 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "nodeAttribute", holder); | 11157 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "nodeAttribute", holder); |
11159 if (block.HasCaught()) { | 11158 if (block.HasCaught()) { |
11160 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11159 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11161 // FIXME: We should support more exceptions. | 11160 // FIXME: We should support more exceptions. |
11162 RELEASE_ASSERT_NOT_REACHED(); | 11161 RELEASE_ASSERT_NOT_REACHED(); |
11163 } | 11162 } |
| 11163 block.ReThrow(); |
11164 return false; | 11164 return false; |
11165 } | 11165 } |
11166 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); | 11166 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); |
11167 RELEASE_ASSERT(!exceptionState.hadException()); | 11167 RELEASE_ASSERT(!exceptionState.hadException()); |
11168 *result = cppValue; | 11168 *result = cppValue; |
11169 return true; | 11169 return true; |
11170 } | 11170 } |
11171 | 11171 |
11172 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame
, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) | 11172 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame
, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) |
11173 { | 11173 { |
11174 if (!frame) | 11174 if (!frame) |
11175 return false; | 11175 return false; |
11176 v8::HandleScope handleScope(toIsolate(frame)); | 11176 v8::HandleScope handleScope(toIsolate(frame)); |
11177 ScriptForbiddenScope::AllowUserAgentScript script; | 11177 ScriptForbiddenScope::AllowUserAgentScript script; |
11178 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11178 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11179 if (context.IsEmpty()) | 11179 if (context.IsEmpty()) |
11180 return false; | 11180 return false; |
11181 ScriptState* scriptState = ScriptState::from(context); | 11181 ScriptState* scriptState = ScriptState::from(context); |
11182 if (!scriptState->executionContext()) | 11182 if (!scriptState->executionContext()) |
11183 return false; | 11183 return false; |
11184 | 11184 |
11185 ScriptState::Scope scope(scriptState); | 11185 ScriptState::Scope scope(scriptState); |
11186 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11186 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11187 | 11187 |
11188 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11188 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
11189 v8::TryCatch block; | 11189 v8::TryCatch block; |
11190 V8RethrowTryCatchScope rethrow(block); | |
11191 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA
ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState-
>isolate())); | 11190 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA
ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState-
>isolate())); |
11192 if (block.HasCaught()) { | 11191 if (block.HasCaught()) { |
11193 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11192 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11194 // FIXME: We should support more exceptions. | 11193 // FIXME: We should support more exceptions. |
11195 RELEASE_ASSERT_NOT_REACHED(); | 11194 RELEASE_ASSERT_NOT_REACHED(); |
11196 } | 11195 } |
| 11196 block.ReThrow(); |
11197 return false; | 11197 return false; |
11198 } | 11198 } |
11199 return true; | 11199 return true; |
11200 } | 11200 } |
11201 | 11201 |
11202 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
ocalFrame* frame, TestObject* holderImpl, String* result) | 11202 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
ocalFrame* frame, TestObject* holderImpl, String* result) |
11203 { | 11203 { |
11204 if (!frame) | 11204 if (!frame) |
11205 return false; | 11205 return false; |
11206 v8::HandleScope handleScope(toIsolate(frame)); | 11206 v8::HandleScope handleScope(toIsolate(frame)); |
11207 ScriptForbiddenScope::AllowUserAgentScript script; | 11207 ScriptForbiddenScope::AllowUserAgentScript script; |
11208 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11208 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11209 if (context.IsEmpty()) | 11209 if (context.IsEmpty()) |
11210 return false; | 11210 return false; |
11211 ScriptState* scriptState = ScriptState::from(context); | 11211 ScriptState* scriptState = ScriptState::from(context); |
11212 if (!scriptState->executionContext()) | 11212 if (!scriptState->executionContext()) |
11213 return false; | 11213 return false; |
11214 | 11214 |
11215 ScriptState::Scope scope(scriptState); | 11215 ScriptState::Scope scope(scriptState); |
11216 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11216 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11217 | 11217 |
11218 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 11218 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
11219 v8::TryCatch block; | 11219 v8::TryCatch block; |
11220 V8RethrowTryCatchScope rethrow(block); | |
11221 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "attributeForPrivateScriptOnly", holder); | 11220 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "attributeForPrivateScriptOnly", holder); |
11222 if (block.HasCaught()) { | 11221 if (block.HasCaught()) { |
11223 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11222 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11224 // FIXME: We should support more exceptions. | 11223 // FIXME: We should support more exceptions. |
11225 RELEASE_ASSERT_NOT_REACHED(); | 11224 RELEASE_ASSERT_NOT_REACHED(); |
11226 } | 11225 } |
| 11226 block.ReThrow(); |
11227 return false; | 11227 return false; |
11228 } | 11228 } |
11229 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 11229 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
11230 RELEASE_ASSERT(!exceptionState.hadException()); | 11230 RELEASE_ASSERT(!exceptionState.hadException()); |
11231 *result = cppValue; | 11231 *result = cppValue; |
11232 return true; | 11232 return true; |
11233 } | 11233 } |
11234 | 11234 |
11235 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L
ocalFrame* frame, TestObject* holderImpl, String cppValue) | 11235 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L
ocalFrame* frame, TestObject* holderImpl, String cppValue) |
11236 { | 11236 { |
11237 if (!frame) | 11237 if (!frame) |
11238 return false; | 11238 return false; |
11239 v8::HandleScope handleScope(toIsolate(frame)); | 11239 v8::HandleScope handleScope(toIsolate(frame)); |
11240 ScriptForbiddenScope::AllowUserAgentScript script; | 11240 ScriptForbiddenScope::AllowUserAgentScript script; |
11241 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11241 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11242 if (context.IsEmpty()) | 11242 if (context.IsEmpty()) |
11243 return false; | 11243 return false; |
11244 ScriptState* scriptState = ScriptState::from(context); | 11244 ScriptState* scriptState = ScriptState::from(context); |
11245 if (!scriptState->executionContext()) | 11245 if (!scriptState->executionContext()) |
11246 return false; | 11246 return false; |
11247 | 11247 |
11248 ScriptState::Scope scope(scriptState); | 11248 ScriptState::Scope scope(scriptState); |
11249 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11249 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
11250 | 11250 |
11251 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 11251 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
11252 v8::TryCatch block; | 11252 v8::TryCatch block; |
11253 V8RethrowTryCatchScope rethrow(block); | |
11254 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "attri
buteForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppValue)); | 11253 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "attri
buteForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppValue)); |
11255 if (block.HasCaught()) { | 11254 if (block.HasCaught()) { |
11256 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11255 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11257 // FIXME: We should support more exceptions. | 11256 // FIXME: We should support more exceptions. |
11258 RELEASE_ASSERT_NOT_REACHED(); | 11257 RELEASE_ASSERT_NOT_REACHED(); |
11259 } | 11258 } |
| 11259 block.ReThrow(); |
11260 return false; | 11260 return false; |
11261 } | 11261 } |
11262 return true; | 11262 return true; |
11263 } | 11263 } |
11264 | 11264 |
11265 } // namespace blink | 11265 } // namespace blink |
OLD | NEW |