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

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

Issue 462623002: Add a missing check for exceptions thrown in methods implemented in private scripts (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY! 5 // This file has been auto-generated by code_generator_v8.py. DO NOT MODIFY!
6 6
7 #include "config.h" 7 #include "config.h"
8 #include "V8TestObject.h" 8 #include "V8TestObject.h"
9 9
10 #include "bindings/core/v8/BindingSecurity.h" 10 #include "bindings/core/v8/BindingSecurity.h"
(...skipping 10686 matching lines...) Expand 10 before | Expand all | Expand 10 after
10697 10697
10698 ScriptState::Scope scope(scriptState); 10698 ScriptState::Scope scope(scriptState);
10699 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 10699 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
10700 10700
10701 v8::Handle<v8::Value> *argv = 0; 10701 v8::Handle<v8::Value> *argv = 0;
10702 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri ptState->isolate()); 10702 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri ptState->isolate());
10703 v8::TryCatch block; 10703 v8::TryCatch block;
10704 V8RethrowTryCatchScope rethrow(block); 10704 V8RethrowTryCatchScope rethrow(block);
10705 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl ementedInPrivateScript", holder, 0, argv); 10705 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl ementedInPrivateScript", holder, 0, argv);
10706 if (block.HasCaught()) { 10706 if (block.HasCaught()) {
10707 PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptStat e->isolate(), exceptionState, block.Exception()); 10707 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10708 // FIXME: We should support more exceptions.
10709 RELEASE_ASSERT_NOT_REACHED();
10710 }
10708 return false; 10711 return false;
10709 } 10712 }
10710 return true; 10713 return true;
10711 } 10714 }
10712 10715
10713 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo calFrame* frame, TestObject* holderImpl, int* result) 10716 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo calFrame* frame, TestObject* holderImpl, int* result)
10714 { 10717 {
10715 if (!frame) 10718 if (!frame)
10716 return false; 10719 return false;
10717 v8::HandleScope handleScope(toIsolate(frame)); 10720 v8::HandleScope handleScope(toIsolate(frame));
10718 ScriptForbiddenScope::AllowUserAgentScript script; 10721 ScriptForbiddenScope::AllowUserAgentScript script;
10719 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 10722 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
10720 if (context.IsEmpty()) 10723 if (context.IsEmpty())
10721 return false; 10724 return false;
10722 ScriptState* scriptState = ScriptState::from(context); 10725 ScriptState* scriptState = ScriptState::from(context);
10723 if (!scriptState->executionContext()) 10726 if (!scriptState->executionContext())
10724 return false; 10727 return false;
10725 10728
10726 ScriptState::Scope scope(scriptState); 10729 ScriptState::Scope scope(scriptState);
10727 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 10730 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
10728 10731
10729 v8::Handle<v8::Value> *argv = 0; 10732 v8::Handle<v8::Value> *argv = 0;
10730 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr iptState->isolate()); 10733 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr iptState->isolate());
10731 v8::TryCatch block; 10734 v8::TryCatch block;
10732 V8RethrowTryCatchScope rethrow(block); 10735 V8RethrowTryCatchScope rethrow(block);
10733 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); 10736 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv);
10734 if (block.HasCaught()) { 10737 if (block.HasCaught()) {
10735 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10738 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10736 // FIXME: We should support exceptions other than DOM exceptions. 10739 // FIXME: We should support more exceptions.
10737 RELEASE_ASSERT_NOT_REACHED(); 10740 RELEASE_ASSERT_NOT_REACHED();
10738 } 10741 }
10739 return false; 10742 return false;
10740 } 10743 }
10741 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); 10744 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false);
10742 RELEASE_ASSERT(!exceptionState.hadException()); 10745 RELEASE_ASSERT(!exceptionState.hadException());
10743 *result = cppValue; 10746 *result = cppValue;
10744 return true; 10747 return true;
10745 } 10748 }
10746 10749
(...skipping 14 matching lines...) Expand all
10761 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 10764 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
10762 10765
10763 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value); 10766 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(), value);
10764 v8::Handle<v8::Value> argv[] = { valueHandle }; 10767 v8::Handle<v8::Value> argv[] = { valueHandle };
10765 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context ()->Global(), scriptState->isolate()); 10768 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context ()->Global(), scriptState->isolate());
10766 v8::TryCatch block; 10769 v8::TryCatch block;
10767 V8RethrowTryCatchScope rethrow(block); 10770 V8RethrowTryCatchScope rethrow(block);
10768 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde r, 1, argv); 10771 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde r, 1, argv);
10769 if (block.HasCaught()) { 10772 if (block.HasCaught()) {
10770 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10773 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10771 // FIXME: We should support exceptions other than DOM exceptions. 10774 // FIXME: We should support more exceptions.
10772 RELEASE_ASSERT_NOT_REACHED(); 10775 RELEASE_ASSERT_NOT_REACHED();
10773 } 10776 }
10774 return false; 10777 return false;
10775 } 10778 }
10776 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); 10779 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false);
10777 RELEASE_ASSERT(!exceptionState.hadException()); 10780 RELEASE_ASSERT(!exceptionState.hadException());
10778 *result = cppValue; 10781 *result = cppValue;
10779 return true; 10782 return true;
10780 } 10783 }
10781 10784
(...skipping 14 matching lines...) Expand all
10796 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 10799 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
10797 10800
10798 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); 10801 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value);
10799 v8::Handle<v8::Value> argv[] = { valueHandle }; 10802 v8::Handle<v8::Value> argv[] = { valueHandle };
10800 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); 10803 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate());
10801 v8::TryCatch block; 10804 v8::TryCatch block;
10802 V8RethrowTryCatchScope rethrow(block); 10805 V8RethrowTryCatchScope rethrow(block);
10803 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol der, 1, argv); 10806 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol der, 1, argv);
10804 if (block.HasCaught()) { 10807 if (block.HasCaught()) {
10805 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10808 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10806 // FIXME: We should support exceptions other than DOM exceptions. 10809 // FIXME: We should support more exceptions.
10807 RELEASE_ASSERT_NOT_REACHED(); 10810 RELEASE_ASSERT_NOT_REACHED();
10808 } 10811 }
10809 return false; 10812 return false;
10810 } 10813 }
10811 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 10814 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false);
10812 RELEASE_ASSERT(!exceptionState.hadException()); 10815 RELEASE_ASSERT(!exceptionState.hadException());
10813 *result = cppValue; 10816 *result = cppValue;
10814 return true; 10817 return true;
10815 } 10818 }
10816 10819
(...skipping 14 matching lines...) Expand all
10831 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 10834 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
10832 10835
10833 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob al(), scriptState->isolate()); 10836 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob al(), scriptState->isolate());
10834 v8::Handle<v8::Value> argv[] = { valueHandle }; 10837 v8::Handle<v8::Value> argv[] = { valueHandle };
10835 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context() ->Global(), scriptState->isolate()); 10838 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context() ->Global(), scriptState->isolate());
10836 v8::TryCatch block; 10839 v8::TryCatch block;
10837 V8RethrowTryCatchScope rethrow(block); 10840 V8RethrowTryCatchScope rethrow(block);
10838 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder, 1, argv); 10841 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder, 1, argv);
10839 if (block.HasCaught()) { 10842 if (block.HasCaught()) {
10840 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10843 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10841 // FIXME: We should support exceptions other than DOM exceptions. 10844 // FIXME: We should support more exceptions.
10842 RELEASE_ASSERT_NOT_REACHED(); 10845 RELEASE_ASSERT_NOT_REACHED();
10843 } 10846 }
10844 return false; 10847 return false;
10845 } 10848 }
10846 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false); 10849 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false);
10847 RELEASE_ASSERT(!exceptionState.hadException()); 10850 RELEASE_ASSERT(!exceptionState.hadException());
10848 *result = cppValue; 10851 *result = cppValue;
10849 return true; 10852 return true;
10850 } 10853 }
10851 10854
(...skipping 18 matching lines...) Expand all
10870 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate() , value1); 10873 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate() , value1);
10871 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(), value2); 10874 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(), value2);
10872 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string ); 10875 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string );
10873 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v alue2Handle, stringHandle }; 10876 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v alue2Handle, stringHandle };
10874 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate()); 10877 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte xt()->Global(), scriptState->isolate());
10875 v8::TryCatch block; 10878 v8::TryCatch block;
10876 V8RethrowTryCatchScope rethrow(block); 10879 V8RethrowTryCatchScope rethrow(block);
10877 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol der, 5, argv); 10880 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol der, 5, argv);
10878 if (block.HasCaught()) { 10881 if (block.HasCaught()) {
10879 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10882 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10880 // FIXME: We should support exceptions other than DOM exceptions. 10883 // FIXME: We should support more exceptions.
10881 RELEASE_ASSERT_NOT_REACHED(); 10884 RELEASE_ASSERT_NOT_REACHED();
10882 } 10885 }
10883 return false; 10886 return false;
10884 } 10887 }
10885 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false); 10888 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false);
10886 RELEASE_ASSERT(!exceptionState.hadException()); 10889 RELEASE_ASSERT(!exceptionState.hadException());
10887 *result = cppValue; 10890 *result = cppValue;
10888 return true; 10891 return true;
10889 } 10892 }
10890 10893
(...skipping 15 matching lines...) Expand all
10906 10909
10907 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate() , value1); 10910 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate() , value1);
10908 v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate() , value2); 10911 v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate() , value2);
10909 v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle }; 10912 v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle };
10910 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate()); 10913 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate());
10911 v8::TryCatch block; 10914 v8::TryCatch block;
10912 V8RethrowTryCatchScope rethrow(block); 10915 V8RethrowTryCatchScope rethrow(block);
10913 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "methodForPrivateScriptOnly", holder, 2, argv); 10916 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat e, "TestObject", "methodForPrivateScriptOnly", holder, 2, argv);
10914 if (block.HasCaught()) { 10917 if (block.HasCaught()) {
10915 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10918 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10916 // FIXME: We should support exceptions other than DOM exceptions. 10919 // FIXME: We should support more exceptions.
10917 RELEASE_ASSERT_NOT_REACHED(); 10920 RELEASE_ASSERT_NOT_REACHED();
10918 } 10921 }
10919 return false; 10922 return false;
10920 } 10923 }
10921 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); 10924 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false);
10922 RELEASE_ASSERT(!exceptionState.hadException()); 10925 RELEASE_ASSERT(!exceptionState.hadException());
10923 *result = cppValue; 10926 *result = cppValue;
10924 return true; 10927 return true;
10925 } 10928 }
10926 10929
(...skipping 12 matching lines...) Expand all
10939 10942
10940 ScriptState::Scope scope(scriptState); 10943 ScriptState::Scope scope(scriptState);
10941 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 10944 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
10942 10945
10943 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate( )); 10946 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate( ));
10944 v8::TryCatch block; 10947 v8::TryCatch block;
10945 V8RethrowTryCatchScope rethrow(block); 10948 V8RethrowTryCatchScope rethrow(block);
10946 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "readonlyShortAttribute", holder); 10949 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "readonlyShortAttribute", holder);
10947 if (block.HasCaught()) { 10950 if (block.HasCaught()) {
10948 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10951 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10949 // FIXME: We should support exceptions other than DOM exceptions. 10952 // FIXME: We should support more exceptions.
10950 RELEASE_ASSERT_NOT_REACHED(); 10953 RELEASE_ASSERT_NOT_REACHED();
10951 } 10954 }
10952 return false; 10955 return false;
10953 } 10956 }
10954 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); 10957 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false);
10955 RELEASE_ASSERT(!exceptionState.hadException()); 10958 RELEASE_ASSERT(!exceptionState.hadException());
10956 *result = cppValue; 10959 *result = cppValue;
10957 return true; 10960 return true;
10958 } 10961 }
10959 10962
(...skipping 12 matching lines...) Expand all
10972 10975
10973 ScriptState::Scope scope(scriptState); 10976 ScriptState::Scope scope(scriptState);
10974 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 10977 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
10975 10978
10976 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 10979 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate());
10977 v8::TryCatch block; 10980 v8::TryCatch block;
10978 V8RethrowTryCatchScope rethrow(block); 10981 V8RethrowTryCatchScope rethrow(block);
10979 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "shortAttribute", holder); 10982 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "shortAttribute", holder);
10980 if (block.HasCaught()) { 10983 if (block.HasCaught()) {
10981 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 10984 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
10982 // FIXME: We should support exceptions other than DOM exceptions. 10985 // FIXME: We should support more exceptions.
10983 RELEASE_ASSERT_NOT_REACHED(); 10986 RELEASE_ASSERT_NOT_REACHED();
10984 } 10987 }
10985 return false; 10988 return false;
10986 } 10989 }
10987 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false); 10990 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta te), exceptionState, false);
10988 RELEASE_ASSERT(!exceptionState.hadException()); 10991 RELEASE_ASSERT(!exceptionState.hadException());
10989 *result = cppValue; 10992 *result = cppValue;
10990 return true; 10993 return true;
10991 } 10994 }
10992 10995
(...skipping 12 matching lines...) Expand all
11005 11008
11006 ScriptState::Scope scope(scriptState); 11009 ScriptState::Scope scope(scriptState);
11007 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11010 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11008 11011
11009 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11012 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute ", "TestObject", scriptState->context()->Global(), scriptState->isolate());
11010 v8::TryCatch block; 11013 v8::TryCatch block;
11011 V8RethrowTryCatchScope rethrow(block); 11014 V8RethrowTryCatchScope rethrow(block);
11012 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); 11015 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue));
11013 if (block.HasCaught()) { 11016 if (block.HasCaught()) {
11014 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11017 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11015 // FIXME: We should support exceptions other than DOM exceptions. 11018 // FIXME: We should support more exceptions.
11016 RELEASE_ASSERT_NOT_REACHED(); 11019 RELEASE_ASSERT_NOT_REACHED();
11017 } 11020 }
11018 return false; 11021 return false;
11019 } 11022 }
11020 return true; 11023 return true;
11021 } 11024 }
11022 11025
11023 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra me, TestObject* holderImpl, String* result) 11026 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra me, TestObject* holderImpl, String* result)
11024 { 11027 {
11025 if (!frame) 11028 if (!frame)
11026 return false; 11029 return false;
11027 v8::HandleScope handleScope(toIsolate(frame)); 11030 v8::HandleScope handleScope(toIsolate(frame));
11028 ScriptForbiddenScope::AllowUserAgentScript script; 11031 ScriptForbiddenScope::AllowUserAgentScript script;
11029 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 11032 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
11030 if (context.IsEmpty()) 11033 if (context.IsEmpty())
11031 return false; 11034 return false;
11032 ScriptState* scriptState = ScriptState::from(context); 11035 ScriptState* scriptState = ScriptState::from(context);
11033 if (!scriptState->executionContext()) 11036 if (!scriptState->executionContext())
11034 return false; 11037 return false;
11035 11038
11036 ScriptState::Scope scope(scriptState); 11039 ScriptState::Scope scope(scriptState);
11037 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11040 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11038 11041
11039 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11042 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate());
11040 v8::TryCatch block; 11043 v8::TryCatch block;
11041 V8RethrowTryCatchScope rethrow(block); 11044 V8RethrowTryCatchScope rethrow(block);
11042 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "stringAttribute", holder); 11045 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "stringAttribute", holder);
11043 if (block.HasCaught()) { 11046 if (block.HasCaught()) {
11044 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11047 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11045 // FIXME: We should support exceptions other than DOM exceptions. 11048 // FIXME: We should support more exceptions.
11046 RELEASE_ASSERT_NOT_REACHED(); 11049 RELEASE_ASSERT_NOT_REACHED();
11047 } 11050 }
11048 return false; 11051 return false;
11049 } 11052 }
11050 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 11053 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false);
11051 RELEASE_ASSERT(!exceptionState.hadException()); 11054 RELEASE_ASSERT(!exceptionState.hadException());
11052 *result = cppValue; 11055 *result = cppValue;
11053 return true; 11056 return true;
11054 } 11057 }
11055 11058
(...skipping 12 matching lines...) Expand all
11068 11071
11069 ScriptState::Scope scope(scriptState); 11072 ScriptState::Scope scope(scriptState);
11070 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11073 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11071 11074
11072 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11075 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut e", "TestObject", scriptState->context()->Global(), scriptState->isolate());
11073 v8::TryCatch block; 11076 v8::TryCatch block;
11074 V8RethrowTryCatchScope rethrow(block); 11077 V8RethrowTryCatchScope rethrow(block);
11075 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin gAttribute", holder, v8String(scriptState->isolate(), cppValue)); 11078 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin gAttribute", holder, v8String(scriptState->isolate(), cppValue));
11076 if (block.HasCaught()) { 11079 if (block.HasCaught()) {
11077 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11080 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11078 // FIXME: We should support exceptions other than DOM exceptions. 11081 // FIXME: We should support more exceptions.
11079 RELEASE_ASSERT_NOT_REACHED(); 11082 RELEASE_ASSERT_NOT_REACHED();
11080 } 11083 }
11081 return false; 11084 return false;
11082 } 11085 }
11083 return true; 11086 return true;
11084 } 11087 }
11085 11088
11086 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame , TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) 11089 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame , TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result)
11087 { 11090 {
11088 if (!frame) 11091 if (!frame)
11089 return false; 11092 return false;
11090 v8::HandleScope handleScope(toIsolate(frame)); 11093 v8::HandleScope handleScope(toIsolate(frame));
11091 ScriptForbiddenScope::AllowUserAgentScript script; 11094 ScriptForbiddenScope::AllowUserAgentScript script;
11092 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 11095 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
11093 if (context.IsEmpty()) 11096 if (context.IsEmpty())
11094 return false; 11097 return false;
11095 ScriptState* scriptState = ScriptState::from(context); 11098 ScriptState* scriptState = ScriptState::from(context);
11096 if (!scriptState->executionContext()) 11099 if (!scriptState->executionContext())
11097 return false; 11100 return false;
11098 11101
11099 ScriptState::Scope scope(scriptState); 11102 ScriptState::Scope scope(scriptState);
11100 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11103 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11101 11104
11102 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11105 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate());
11103 v8::TryCatch block; 11106 v8::TryCatch block;
11104 V8RethrowTryCatchScope rethrow(block); 11107 V8RethrowTryCatchScope rethrow(block);
11105 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "nodeAttribute", holder); 11108 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "nodeAttribute", holder);
11106 if (block.HasCaught()) { 11109 if (block.HasCaught()) {
11107 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11110 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11108 // FIXME: We should support exceptions other than DOM exceptions. 11111 // FIXME: We should support more exceptions.
11109 RELEASE_ASSERT_NOT_REACHED(); 11112 RELEASE_ASSERT_NOT_REACHED();
11110 } 11113 }
11111 return false; 11114 return false;
11112 } 11115 }
11113 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false); 11116 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState- >isolate(), v8Value), false);
11114 RELEASE_ASSERT(!exceptionState.hadException()); 11117 RELEASE_ASSERT(!exceptionState.hadException());
11115 *result = cppValue; 11118 *result = cppValue;
11116 return true; 11119 return true;
11117 } 11120 }
11118 11121
(...skipping 12 matching lines...) Expand all
11131 11134
11132 ScriptState::Scope scope(scriptState); 11135 ScriptState::Scope scope(scriptState);
11133 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11136 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11134 11137
11135 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate()); 11138 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute" , "TestObject", scriptState->context()->Global(), scriptState->isolate());
11136 v8::TryCatch block; 11139 v8::TryCatch block;
11137 V8RethrowTryCatchScope rethrow(block); 11140 V8RethrowTryCatchScope rethrow(block);
11138 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState- >isolate())); 11141 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState- >isolate()));
11139 if (block.HasCaught()) { 11142 if (block.HasCaught()) {
11140 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11143 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11141 // FIXME: We should support exceptions other than DOM exceptions. 11144 // FIXME: We should support more exceptions.
11142 RELEASE_ASSERT_NOT_REACHED(); 11145 RELEASE_ASSERT_NOT_REACHED();
11143 } 11146 }
11144 return false; 11147 return false;
11145 } 11148 }
11146 return true; 11149 return true;
11147 } 11150 }
11148 11151
11149 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L ocalFrame* frame, TestObject* holderImpl, String* result) 11152 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L ocalFrame* frame, TestObject* holderImpl, String* result)
11150 { 11153 {
11151 if (!frame) 11154 if (!frame)
11152 return false; 11155 return false;
11153 v8::HandleScope handleScope(toIsolate(frame)); 11156 v8::HandleScope handleScope(toIsolate(frame));
11154 ScriptForbiddenScope::AllowUserAgentScript script; 11157 ScriptForbiddenScope::AllowUserAgentScript script;
11155 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld()); 11158 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat eScriptIsolatedWorld());
11156 if (context.IsEmpty()) 11159 if (context.IsEmpty())
11157 return false; 11160 return false;
11158 ScriptState* scriptState = ScriptState::from(context); 11161 ScriptState* scriptState = ScriptState::from(context);
11159 if (!scriptState->executionContext()) 11162 if (!scriptState->executionContext())
11160 return false; 11163 return false;
11161 11164
11162 ScriptState::Scope scope(scriptState); 11165 ScriptState::Scope scope(scriptState);
11163 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11166 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11164 11167
11165 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate()); 11168 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate());
11166 v8::TryCatch block; 11169 v8::TryCatch block;
11167 V8RethrowTryCatchScope rethrow(block); 11170 V8RethrowTryCatchScope rethrow(block);
11168 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "attributeForPrivateScriptOnly", holder); 11171 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s criptState, "TestObject", "attributeForPrivateScriptOnly", holder);
11169 if (block.HasCaught()) { 11172 if (block.HasCaught()) {
11170 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11173 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11171 // FIXME: We should support exceptions other than DOM exceptions. 11174 // FIXME: We should support more exceptions.
11172 RELEASE_ASSERT_NOT_REACHED(); 11175 RELEASE_ASSERT_NOT_REACHED();
11173 } 11176 }
11174 return false; 11177 return false;
11175 } 11178 }
11176 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); 11179 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false);
11177 RELEASE_ASSERT(!exceptionState.hadException()); 11180 RELEASE_ASSERT(!exceptionState.hadException());
11178 *result = cppValue; 11181 *result = cppValue;
11179 return true; 11182 return true;
11180 } 11183 }
11181 11184
(...skipping 12 matching lines...) Expand all
11194 11197
11195 ScriptState::Scope scope(scriptState); 11198 ScriptState::Scope scope(scriptState);
11196 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate()); 11199 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob al(), scriptState->isolate());
11197 11200
11198 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate()); 11201 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i solate());
11199 v8::TryCatch block; 11202 v8::TryCatch block;
11200 V8RethrowTryCatchScope rethrow(block); 11203 V8RethrowTryCatchScope rethrow(block);
11201 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "attri buteForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppValue)); 11204 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "attri buteForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppValue));
11202 if (block.HasCaught()) { 11205 if (block.HasCaught()) {
11203 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) { 11206 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip tState->isolate(), exceptionState, block.Exception())) {
11204 // FIXME: We should support exceptions other than DOM exceptions. 11207 // FIXME: We should support more exceptions.
11205 RELEASE_ASSERT_NOT_REACHED(); 11208 RELEASE_ASSERT_NOT_REACHED();
11206 } 11209 }
11207 return false; 11210 return false;
11208 } 11211 }
11209 return true; 11212 return true;
11210 } 11213 }
11211 11214
11212 } // namespace blink 11215 } // namespace blink
OLDNEW
« no previous file with comments | « Source/bindings/tests/results/V8TestInterface.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698