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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 #include "core/dom/Document.h" | 54 #include "core/dom/Document.h" |
55 #include "core/dom/TagCollection.h" | 55 #include "core/dom/TagCollection.h" |
56 #include "core/dom/custom/CustomElementCallbackDispatcher.h" | 56 #include "core/dom/custom/CustomElementCallbackDispatcher.h" |
57 #include "core/frame/LocalFrame.h" | 57 #include "core/frame/LocalFrame.h" |
58 #include "core/frame/UseCounter.h" | 58 #include "core/frame/UseCounter.h" |
59 #include "core/html/HTMLCollection.h" | 59 #include "core/html/HTMLCollection.h" |
60 #include "core/html/HTMLFormControlsCollection.h" | 60 #include "core/html/HTMLFormControlsCollection.h" |
61 #include "core/html/HTMLTableRowsCollection.h" | 61 #include "core/html/HTMLTableRowsCollection.h" |
62 #include "core/inspector/ScriptArguments.h" | 62 #include "core/inspector/ScriptArguments.h" |
63 #include "platform/RuntimeEnabledFeatures.h" | 63 #include "platform/RuntimeEnabledFeatures.h" |
| 64 #include "platform/ScriptForbiddenScope.h" |
64 #include "platform/TraceEvent.h" | 65 #include "platform/TraceEvent.h" |
65 #include "wtf/GetPtr.h" | 66 #include "wtf/GetPtr.h" |
66 #include "wtf/RefPtr.h" | 67 #include "wtf/RefPtr.h" |
67 | 68 |
68 namespace blink { | 69 namespace blink { |
69 | 70 |
70 static void initializeScriptWrappableForInterface(TestObject* object) | 71 static void initializeScriptWrappableForInterface(TestObject* object) |
71 { | 72 { |
72 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) | 73 if (ScriptWrappable::wrapperCanBeStoredInObject(object)) |
73 ScriptWrappable::fromObject(object)->setTypeInfo(&V8TestObject::wrapperT
ypeInfo); | 74 ScriptWrappable::fromObject(object)->setTypeInfo(&V8TestObject::wrapperT
ypeInfo); |
(...skipping 10544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
10618 template<> | 10619 template<> |
10619 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) | 10620 v8::Handle<v8::Value> toV8NoInline(TestObject* impl, v8::Handle<v8::Object> crea
tionContext, v8::Isolate* isolate) |
10620 { | 10621 { |
10621 return toV8(impl, creationContext, isolate); | 10622 return toV8(impl, creationContext, isolate); |
10622 } | 10623 } |
10623 | 10624 |
10624 bool V8TestObject::voidMethodImplementedInPrivateScriptMethodImplementedInPrivat
eScript(LocalFrame* frame, TestObject* holderImpl) | 10625 bool V8TestObject::voidMethodImplementedInPrivateScriptMethodImplementedInPrivat
eScript(LocalFrame* frame, TestObject* holderImpl) |
10625 { | 10626 { |
10626 if (!frame) | 10627 if (!frame) |
10627 return false; | 10628 return false; |
| 10629 v8::HandleScope handleScope(toIsolate(frame)); |
| 10630 ScriptForbiddenScope::AllowUserAgentScript script; |
10628 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10631 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10629 if (context.IsEmpty()) | 10632 if (context.IsEmpty()) |
10630 return false; | 10633 return false; |
10631 ScriptState* scriptState = ScriptState::from(context); | 10634 ScriptState* scriptState = ScriptState::from(context); |
10632 if (!scriptState->executionContext()) | 10635 if (!scriptState->executionContext()) |
10633 return false; | 10636 return false; |
10634 | 10637 |
10635 ScriptState::Scope scope(scriptState); | 10638 ScriptState::Scope scope(scriptState); |
10636 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10639 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10637 | 10640 |
10638 v8::Handle<v8::Value> *argv = 0; | 10641 v8::Handle<v8::Value> *argv = 0; |
10639 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); | 10642 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); |
10640 v8::TryCatch block; | 10643 v8::TryCatch block; |
10641 V8RethrowTryCatchScope rethrow(block); | 10644 V8RethrowTryCatchScope rethrow(block); |
10642 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl
ementedInPrivateScript", holder, 0, argv); | 10645 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl
ementedInPrivateScript", holder, 0, argv); |
10643 if (block.HasCaught()) { | 10646 if (block.HasCaught()) { |
10644 PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptStat
e->isolate(), exceptionState, block.Exception()); | 10647 PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scriptStat
e->isolate(), exceptionState, block.Exception()); |
10645 return false; | 10648 return false; |
10646 } | 10649 } |
10647 return true; | 10650 return true; |
10648 } | 10651 } |
10649 | 10652 |
10650 bool V8TestObject::shortMethodImplementedInPrivateScriptMethodImplementedInPriva
teScript(LocalFrame* frame, TestObject* holderImpl, int* result) | 10653 bool V8TestObject::shortMethodImplementedInPrivateScriptMethodImplementedInPriva
teScript(LocalFrame* frame, TestObject* holderImpl, int* result) |
10651 { | 10654 { |
10652 if (!frame) | 10655 if (!frame) |
10653 return false; | 10656 return false; |
| 10657 v8::HandleScope handleScope(toIsolate(frame)); |
| 10658 ScriptForbiddenScope::AllowUserAgentScript script; |
10654 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10659 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10655 if (context.IsEmpty()) | 10660 if (context.IsEmpty()) |
10656 return false; | 10661 return false; |
10657 ScriptState* scriptState = ScriptState::from(context); | 10662 ScriptState* scriptState = ScriptState::from(context); |
10658 if (!scriptState->executionContext()) | 10663 if (!scriptState->executionContext()) |
10659 return false; | 10664 return false; |
10660 | 10665 |
10661 ScriptState::Scope scope(scriptState); | 10666 ScriptState::Scope scope(scriptState); |
10662 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10667 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10663 | 10668 |
(...skipping 12 matching lines...) Expand all Loading... |
10676 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10681 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10677 RELEASE_ASSERT(!exceptionState.hadException()); | 10682 RELEASE_ASSERT(!exceptionState.hadException()); |
10678 *result = cppValue; | 10683 *result = cppValue; |
10679 return true; | 10684 return true; |
10680 } | 10685 } |
10681 | 10686 |
10682 bool V8TestObject::shortMethodWithShortArgumentImplementedInPrivateScriptMethodI
mplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, int value,
int* result) | 10687 bool V8TestObject::shortMethodWithShortArgumentImplementedInPrivateScriptMethodI
mplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, int value,
int* result) |
10683 { | 10688 { |
10684 if (!frame) | 10689 if (!frame) |
10685 return false; | 10690 return false; |
| 10691 v8::HandleScope handleScope(toIsolate(frame)); |
| 10692 ScriptForbiddenScope::AllowUserAgentScript script; |
10686 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10693 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10687 if (context.IsEmpty()) | 10694 if (context.IsEmpty()) |
10688 return false; | 10695 return false; |
10689 ScriptState* scriptState = ScriptState::from(context); | 10696 ScriptState* scriptState = ScriptState::from(context); |
10690 if (!scriptState->executionContext()) | 10697 if (!scriptState->executionContext()) |
10691 return false; | 10698 return false; |
10692 | 10699 |
10693 ScriptState::Scope scope(scriptState); | 10700 ScriptState::Scope scope(scriptState); |
10694 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10701 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10695 | 10702 |
(...skipping 13 matching lines...) Expand all Loading... |
10709 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10716 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10710 RELEASE_ASSERT(!exceptionState.hadException()); | 10717 RELEASE_ASSERT(!exceptionState.hadException()); |
10711 *result = cppValue; | 10718 *result = cppValue; |
10712 return true; | 10719 return true; |
10713 } | 10720 } |
10714 | 10721 |
10715 bool V8TestObject::stringMethodWithStringArgumentImplementedInPrivateScriptMetho
dImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, String va
lue, String* result) | 10722 bool V8TestObject::stringMethodWithStringArgumentImplementedInPrivateScriptMetho
dImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, String va
lue, String* result) |
10716 { | 10723 { |
10717 if (!frame) | 10724 if (!frame) |
10718 return false; | 10725 return false; |
| 10726 v8::HandleScope handleScope(toIsolate(frame)); |
| 10727 ScriptForbiddenScope::AllowUserAgentScript script; |
10719 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10728 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10720 if (context.IsEmpty()) | 10729 if (context.IsEmpty()) |
10721 return false; | 10730 return false; |
10722 ScriptState* scriptState = ScriptState::from(context); | 10731 ScriptState* scriptState = ScriptState::from(context); |
10723 if (!scriptState->executionContext()) | 10732 if (!scriptState->executionContext()) |
10724 return false; | 10733 return false; |
10725 | 10734 |
10726 ScriptState::Scope scope(scriptState); | 10735 ScriptState::Scope scope(scriptState); |
10727 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10736 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10728 | 10737 |
(...skipping 13 matching lines...) Expand all Loading... |
10742 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 10751 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
10743 RELEASE_ASSERT(!exceptionState.hadException()); | 10752 RELEASE_ASSERT(!exceptionState.hadException()); |
10744 *result = cppValue; | 10753 *result = cppValue; |
10745 return true; | 10754 return true; |
10746 } | 10755 } |
10747 | 10756 |
10748 bool V8TestObject::nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodImp
lementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWil
lBeRawPtr<Node> value, RefPtrWillBeRawPtr<Node>* result) | 10757 bool V8TestObject::nodeMethodWithNodeArgumentImplementedInPrivateScriptMethodImp
lementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWil
lBeRawPtr<Node> value, RefPtrWillBeRawPtr<Node>* result) |
10749 { | 10758 { |
10750 if (!frame) | 10759 if (!frame) |
10751 return false; | 10760 return false; |
| 10761 v8::HandleScope handleScope(toIsolate(frame)); |
| 10762 ScriptForbiddenScope::AllowUserAgentScript script; |
10752 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10763 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10753 if (context.IsEmpty()) | 10764 if (context.IsEmpty()) |
10754 return false; | 10765 return false; |
10755 ScriptState* scriptState = ScriptState::from(context); | 10766 ScriptState* scriptState = ScriptState::from(context); |
10756 if (!scriptState->executionContext()) | 10767 if (!scriptState->executionContext()) |
10757 return false; | 10768 return false; |
10758 | 10769 |
10759 ScriptState::Scope scope(scriptState); | 10770 ScriptState::Scope scope(scriptState); |
10760 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10771 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10761 | 10772 |
(...skipping 13 matching lines...) Expand all Loading... |
10775 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); | 10786 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); |
10776 RELEASE_ASSERT(!exceptionState.hadException()); | 10787 RELEASE_ASSERT(!exceptionState.hadException()); |
10777 *result = cppValue; | 10788 *result = cppValue; |
10778 return true; | 10789 return true; |
10779 } | 10790 } |
10780 | 10791 |
10781 bool V8TestObject::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMetho
dImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, PassRefPt
rWillBeRawPtr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1,
double value2, String string, RefPtrWillBeRawPtr<Node>* result) | 10792 bool V8TestObject::nodeMethodWithVariousArgumentsImplementedInPrivateScriptMetho
dImplementedInPrivateScript(LocalFrame* frame, TestObject* holderImpl, PassRefPt
rWillBeRawPtr<Document> document, PassRefPtrWillBeRawPtr<Node> node, int value1,
double value2, String string, RefPtrWillBeRawPtr<Node>* result) |
10782 { | 10793 { |
10783 if (!frame) | 10794 if (!frame) |
10784 return false; | 10795 return false; |
| 10796 v8::HandleScope handleScope(toIsolate(frame)); |
| 10797 ScriptForbiddenScope::AllowUserAgentScript script; |
10785 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10798 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10786 if (context.IsEmpty()) | 10799 if (context.IsEmpty()) |
10787 return false; | 10800 return false; |
10788 ScriptState* scriptState = ScriptState::from(context); | 10801 ScriptState* scriptState = ScriptState::from(context); |
10789 if (!scriptState->executionContext()) | 10802 if (!scriptState->executionContext()) |
10790 return false; | 10803 return false; |
10791 | 10804 |
10792 ScriptState::Scope scope(scriptState); | 10805 ScriptState::Scope scope(scriptState); |
10793 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10806 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10794 | 10807 |
(...skipping 17 matching lines...) Expand all Loading... |
10812 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); | 10825 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); |
10813 RELEASE_ASSERT(!exceptionState.hadException()); | 10826 RELEASE_ASSERT(!exceptionState.hadException()); |
10814 *result = cppValue; | 10827 *result = cppValue; |
10815 return true; | 10828 return true; |
10816 } | 10829 } |
10817 | 10830 |
10818 bool V8TestObject::addIntegerForPrivateScriptOnlyMethodImplementedInPrivateScrip
t(LocalFrame* frame, TestObject* holderImpl, int value1, int value2, int* result
) | 10831 bool V8TestObject::addIntegerForPrivateScriptOnlyMethodImplementedInPrivateScrip
t(LocalFrame* frame, TestObject* holderImpl, int value1, int value2, int* result
) |
10819 { | 10832 { |
10820 if (!frame) | 10833 if (!frame) |
10821 return false; | 10834 return false; |
| 10835 v8::HandleScope handleScope(toIsolate(frame)); |
| 10836 ScriptForbiddenScope::AllowUserAgentScript script; |
10822 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10837 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10823 if (context.IsEmpty()) | 10838 if (context.IsEmpty()) |
10824 return false; | 10839 return false; |
10825 ScriptState* scriptState = ScriptState::from(context); | 10840 ScriptState* scriptState = ScriptState::from(context); |
10826 if (!scriptState->executionContext()) | 10841 if (!scriptState->executionContext()) |
10827 return false; | 10842 return false; |
10828 | 10843 |
10829 ScriptState::Scope scope(scriptState); | 10844 ScriptState::Scope scope(scriptState); |
10830 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10845 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10831 | 10846 |
(...skipping 14 matching lines...) Expand all Loading... |
10846 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10861 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10847 RELEASE_ASSERT(!exceptionState.hadException()); | 10862 RELEASE_ASSERT(!exceptionState.hadException()); |
10848 *result = cppValue; | 10863 *result = cppValue; |
10849 return true; | 10864 return true; |
10850 } | 10865 } |
10851 | 10866 |
10852 bool V8TestObject::readonlyShortAttributeAttributeGetterImplementedInPrivateScri
pt(LocalFrame* frame, TestObject* holderImpl, int* result) | 10867 bool V8TestObject::readonlyShortAttributeAttributeGetterImplementedInPrivateScri
pt(LocalFrame* frame, TestObject* holderImpl, int* result) |
10853 { | 10868 { |
10854 if (!frame) | 10869 if (!frame) |
10855 return false; | 10870 return false; |
| 10871 v8::HandleScope handleScope(toIsolate(frame)); |
| 10872 ScriptForbiddenScope::AllowUserAgentScript script; |
10856 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10873 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10857 if (context.IsEmpty()) | 10874 if (context.IsEmpty()) |
10858 return false; | 10875 return false; |
10859 ScriptState* scriptState = ScriptState::from(context); | 10876 ScriptState* scriptState = ScriptState::from(context); |
10860 if (!scriptState->executionContext()) | 10877 if (!scriptState->executionContext()) |
10861 return false; | 10878 return false; |
10862 | 10879 |
10863 ScriptState::Scope scope(scriptState); | 10880 ScriptState::Scope scope(scriptState); |
10864 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10881 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10865 | 10882 |
(...skipping 11 matching lines...) Expand all Loading... |
10877 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10894 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10878 RELEASE_ASSERT(!exceptionState.hadException()); | 10895 RELEASE_ASSERT(!exceptionState.hadException()); |
10879 *result = cppValue; | 10896 *result = cppValue; |
10880 return true; | 10897 return true; |
10881 } | 10898 } |
10882 | 10899 |
10883 bool V8TestObject::shortAttributeAttributeGetterImplementedInPrivateScript(Local
Frame* frame, TestObject* holderImpl, int* result) | 10900 bool V8TestObject::shortAttributeAttributeGetterImplementedInPrivateScript(Local
Frame* frame, TestObject* holderImpl, int* result) |
10884 { | 10901 { |
10885 if (!frame) | 10902 if (!frame) |
10886 return false; | 10903 return false; |
| 10904 v8::HandleScope handleScope(toIsolate(frame)); |
| 10905 ScriptForbiddenScope::AllowUserAgentScript script; |
10887 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10906 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10888 if (context.IsEmpty()) | 10907 if (context.IsEmpty()) |
10889 return false; | 10908 return false; |
10890 ScriptState* scriptState = ScriptState::from(context); | 10909 ScriptState* scriptState = ScriptState::from(context); |
10891 if (!scriptState->executionContext()) | 10910 if (!scriptState->executionContext()) |
10892 return false; | 10911 return false; |
10893 | 10912 |
10894 ScriptState::Scope scope(scriptState); | 10913 ScriptState::Scope scope(scriptState); |
10895 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10914 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10896 | 10915 |
(...skipping 11 matching lines...) Expand all Loading... |
10908 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10927 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
10909 RELEASE_ASSERT(!exceptionState.hadException()); | 10928 RELEASE_ASSERT(!exceptionState.hadException()); |
10910 *result = cppValue; | 10929 *result = cppValue; |
10911 return true; | 10930 return true; |
10912 } | 10931 } |
10913 | 10932 |
10914 bool V8TestObject::shortAttributeAttributeSetterImplementedInPrivateScript(Local
Frame* frame, TestObject* holderImpl, int cppValue) | 10933 bool V8TestObject::shortAttributeAttributeSetterImplementedInPrivateScript(Local
Frame* frame, TestObject* holderImpl, int cppValue) |
10915 { | 10934 { |
10916 if (!frame) | 10935 if (!frame) |
10917 return false; | 10936 return false; |
| 10937 v8::HandleScope handleScope(toIsolate(frame)); |
| 10938 ScriptForbiddenScope::AllowUserAgentScript script; |
10918 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10939 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10919 if (context.IsEmpty()) | 10940 if (context.IsEmpty()) |
10920 return false; | 10941 return false; |
10921 ScriptState* scriptState = ScriptState::from(context); | 10942 ScriptState* scriptState = ScriptState::from(context); |
10922 if (!scriptState->executionContext()) | 10943 if (!scriptState->executionContext()) |
10923 return false; | 10944 return false; |
10924 | 10945 |
10925 ScriptState::Scope scope(scriptState); | 10946 ScriptState::Scope scope(scriptState); |
10926 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10947 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
10927 | 10948 |
10928 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 10949 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
10929 v8::TryCatch block; | 10950 v8::TryCatch block; |
10930 V8RethrowTryCatchScope rethrow(block); | 10951 V8RethrowTryCatchScope rethrow(block); |
10931 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short
Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); | 10952 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short
Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); |
10932 if (block.HasCaught()) { | 10953 if (block.HasCaught()) { |
10933 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 10954 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10934 // FIXME: We should support exceptions other than DOM exceptions. | 10955 // FIXME: We should support exceptions other than DOM exceptions. |
10935 RELEASE_ASSERT_NOT_REACHED(); | 10956 RELEASE_ASSERT_NOT_REACHED(); |
10936 } | 10957 } |
10937 return false; | 10958 return false; |
10938 } | 10959 } |
10939 return true; | 10960 return true; |
10940 } | 10961 } |
10941 | 10962 |
10942 bool V8TestObject::stringAttributeAttributeGetterImplementedInPrivateScript(Loca
lFrame* frame, TestObject* holderImpl, String* result) | 10963 bool V8TestObject::stringAttributeAttributeGetterImplementedInPrivateScript(Loca
lFrame* frame, TestObject* holderImpl, String* result) |
10943 { | 10964 { |
10944 if (!frame) | 10965 if (!frame) |
10945 return false; | 10966 return false; |
| 10967 v8::HandleScope handleScope(toIsolate(frame)); |
| 10968 ScriptForbiddenScope::AllowUserAgentScript script; |
10946 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 10969 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10947 if (context.IsEmpty()) | 10970 if (context.IsEmpty()) |
10948 return false; | 10971 return false; |
10949 ScriptState* scriptState = ScriptState::from(context); | 10972 ScriptState* scriptState = ScriptState::from(context); |
10950 if (!scriptState->executionContext()) | 10973 if (!scriptState->executionContext()) |
10951 return false; | 10974 return false; |
10952 | 10975 |
10953 ScriptState::Scope scope(scriptState); | 10976 ScriptState::Scope scope(scriptState); |
10954 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()); |
10955 | 10978 |
(...skipping 11 matching lines...) Expand all Loading... |
10967 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 10990 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
10968 RELEASE_ASSERT(!exceptionState.hadException()); | 10991 RELEASE_ASSERT(!exceptionState.hadException()); |
10969 *result = cppValue; | 10992 *result = cppValue; |
10970 return true; | 10993 return true; |
10971 } | 10994 } |
10972 | 10995 |
10973 bool V8TestObject::stringAttributeAttributeSetterImplementedInPrivateScript(Loca
lFrame* frame, TestObject* holderImpl, String cppValue) | 10996 bool V8TestObject::stringAttributeAttributeSetterImplementedInPrivateScript(Loca
lFrame* frame, TestObject* holderImpl, String cppValue) |
10974 { | 10997 { |
10975 if (!frame) | 10998 if (!frame) |
10976 return false; | 10999 return false; |
| 11000 v8::HandleScope handleScope(toIsolate(frame)); |
| 11001 ScriptForbiddenScope::AllowUserAgentScript script; |
10977 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11002 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
10978 if (context.IsEmpty()) | 11003 if (context.IsEmpty()) |
10979 return false; | 11004 return false; |
10980 ScriptState* scriptState = ScriptState::from(context); | 11005 ScriptState* scriptState = ScriptState::from(context); |
10981 if (!scriptState->executionContext()) | 11006 if (!scriptState->executionContext()) |
10982 return false; | 11007 return false; |
10983 | 11008 |
10984 ScriptState::Scope scope(scriptState); | 11009 ScriptState::Scope scope(scriptState); |
10985 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()); |
10986 | 11011 |
10987 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11012 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
10988 v8::TryCatch block; | 11013 v8::TryCatch block; |
10989 V8RethrowTryCatchScope rethrow(block); | 11014 V8RethrowTryCatchScope rethrow(block); |
10990 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin
gAttribute", holder, v8String(scriptState->isolate(), cppValue)); | 11015 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin
gAttribute", holder, v8String(scriptState->isolate(), cppValue)); |
10991 if (block.HasCaught()) { | 11016 if (block.HasCaught()) { |
10992 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11017 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
10993 // FIXME: We should support exceptions other than DOM exceptions. | 11018 // FIXME: We should support exceptions other than DOM exceptions. |
10994 RELEASE_ASSERT_NOT_REACHED(); | 11019 RELEASE_ASSERT_NOT_REACHED(); |
10995 } | 11020 } |
10996 return false; | 11021 return false; |
10997 } | 11022 } |
10998 return true; | 11023 return true; |
10999 } | 11024 } |
11000 | 11025 |
11001 bool V8TestObject::nodeAttributeAttributeGetterImplementedInPrivateScript(LocalF
rame* frame, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) | 11026 bool V8TestObject::nodeAttributeAttributeGetterImplementedInPrivateScript(LocalF
rame* frame, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) |
11002 { | 11027 { |
11003 if (!frame) | 11028 if (!frame) |
11004 return false; | 11029 return false; |
| 11030 v8::HandleScope handleScope(toIsolate(frame)); |
| 11031 ScriptForbiddenScope::AllowUserAgentScript script; |
11005 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11032 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11006 if (context.IsEmpty()) | 11033 if (context.IsEmpty()) |
11007 return false; | 11034 return false; |
11008 ScriptState* scriptState = ScriptState::from(context); | 11035 ScriptState* scriptState = ScriptState::from(context); |
11009 if (!scriptState->executionContext()) | 11036 if (!scriptState->executionContext()) |
11010 return false; | 11037 return false; |
11011 | 11038 |
11012 ScriptState::Scope scope(scriptState); | 11039 ScriptState::Scope scope(scriptState); |
11013 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()); |
11014 | 11041 |
(...skipping 11 matching lines...) Expand all Loading... |
11026 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); | 11053 TONATIVE_DEFAULT(Node*, cppValue, V8Node::toNativeWithTypeCheck(scriptState-
>isolate(), v8Value), false); |
11027 RELEASE_ASSERT(!exceptionState.hadException()); | 11054 RELEASE_ASSERT(!exceptionState.hadException()); |
11028 *result = cppValue; | 11055 *result = cppValue; |
11029 return true; | 11056 return true; |
11030 } | 11057 } |
11031 | 11058 |
11032 bool V8TestObject::nodeAttributeAttributeSetterImplementedInPrivateScript(LocalF
rame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) | 11059 bool V8TestObject::nodeAttributeAttributeSetterImplementedInPrivateScript(LocalF
rame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) |
11033 { | 11060 { |
11034 if (!frame) | 11061 if (!frame) |
11035 return false; | 11062 return false; |
| 11063 v8::HandleScope handleScope(toIsolate(frame)); |
| 11064 ScriptForbiddenScope::AllowUserAgentScript script; |
11036 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11065 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11037 if (context.IsEmpty()) | 11066 if (context.IsEmpty()) |
11038 return false; | 11067 return false; |
11039 ScriptState* scriptState = ScriptState::from(context); | 11068 ScriptState* scriptState = ScriptState::from(context); |
11040 if (!scriptState->executionContext()) | 11069 if (!scriptState->executionContext()) |
11041 return false; | 11070 return false; |
11042 | 11071 |
11043 ScriptState::Scope scope(scriptState); | 11072 ScriptState::Scope scope(scriptState); |
11044 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()); |
11045 | 11074 |
11046 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 11075 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
11047 v8::TryCatch block; | 11076 v8::TryCatch block; |
11048 V8RethrowTryCatchScope rethrow(block); | 11077 V8RethrowTryCatchScope rethrow(block); |
11049 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA
ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState-
>isolate())); | 11078 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA
ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState-
>isolate())); |
11050 if (block.HasCaught()) { | 11079 if (block.HasCaught()) { |
11051 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11080 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11052 // FIXME: We should support exceptions other than DOM exceptions. | 11081 // FIXME: We should support exceptions other than DOM exceptions. |
11053 RELEASE_ASSERT_NOT_REACHED(); | 11082 RELEASE_ASSERT_NOT_REACHED(); |
11054 } | 11083 } |
11055 return false; | 11084 return false; |
11056 } | 11085 } |
11057 return true; | 11086 return true; |
11058 } | 11087 } |
11059 | 11088 |
11060 bool V8TestObject::stringAttributeForPrivateScriptOnlyAttributeGetterImplemented
InPrivateScript(LocalFrame* frame, TestObject* holderImpl, String* result) | 11089 bool V8TestObject::stringAttributeForPrivateScriptOnlyAttributeGetterImplemented
InPrivateScript(LocalFrame* frame, TestObject* holderImpl, String* result) |
11061 { | 11090 { |
11062 if (!frame) | 11091 if (!frame) |
11063 return false; | 11092 return false; |
| 11093 v8::HandleScope handleScope(toIsolate(frame)); |
| 11094 ScriptForbiddenScope::AllowUserAgentScript script; |
11064 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11095 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11065 if (context.IsEmpty()) | 11096 if (context.IsEmpty()) |
11066 return false; | 11097 return false; |
11067 ScriptState* scriptState = ScriptState::from(context); | 11098 ScriptState* scriptState = ScriptState::from(context); |
11068 if (!scriptState->executionContext()) | 11099 if (!scriptState->executionContext()) |
11069 return false; | 11100 return false; |
11070 | 11101 |
11071 ScriptState::Scope scope(scriptState); | 11102 ScriptState::Scope scope(scriptState); |
11072 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()); |
11073 | 11104 |
(...skipping 11 matching lines...) Expand all Loading... |
11085 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 11116 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
11086 RELEASE_ASSERT(!exceptionState.hadException()); | 11117 RELEASE_ASSERT(!exceptionState.hadException()); |
11087 *result = cppValue; | 11118 *result = cppValue; |
11088 return true; | 11119 return true; |
11089 } | 11120 } |
11090 | 11121 |
11091 bool V8TestObject::stringAttributeForPrivateScriptOnlyAttributeSetterImplemented
InPrivateScript(LocalFrame* frame, TestObject* holderImpl, String cppValue) | 11122 bool V8TestObject::stringAttributeForPrivateScriptOnlyAttributeSetterImplemented
InPrivateScript(LocalFrame* frame, TestObject* holderImpl, String cppValue) |
11092 { | 11123 { |
11093 if (!frame) | 11124 if (!frame) |
11094 return false; | 11125 return false; |
| 11126 v8::HandleScope handleScope(toIsolate(frame)); |
| 11127 ScriptForbiddenScope::AllowUserAgentScript script; |
11095 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); | 11128 v8::Handle<v8::Context> context = toV8Context(frame, DOMWrapperWorld::privat
eScriptIsolatedWorld()); |
11096 if (context.IsEmpty()) | 11129 if (context.IsEmpty()) |
11097 return false; | 11130 return false; |
11098 ScriptState* scriptState = ScriptState::from(context); | 11131 ScriptState* scriptState = ScriptState::from(context); |
11099 if (!scriptState->executionContext()) | 11132 if (!scriptState->executionContext()) |
11100 return false; | 11133 return false; |
11101 | 11134 |
11102 ScriptState::Scope scope(scriptState); | 11135 ScriptState::Scope scope(scriptState); |
11103 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()); |
11104 | 11137 |
11105 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
eForPrivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptSt
ate->isolate()); | 11138 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
eForPrivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptSt
ate->isolate()); |
11106 v8::TryCatch block; | 11139 v8::TryCatch block; |
11107 V8RethrowTryCatchScope rethrow(block); | 11140 V8RethrowTryCatchScope rethrow(block); |
11108 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin
gAttributeForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppVal
ue)); | 11141 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin
gAttributeForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppVal
ue)); |
11109 if (block.HasCaught()) { | 11142 if (block.HasCaught()) { |
11110 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { | 11143 if (!PrivateScriptRunner::throwDOMExceptionInPrivateScriptIfNeeded(scrip
tState->isolate(), exceptionState, block.Exception())) { |
11111 // FIXME: We should support exceptions other than DOM exceptions. | 11144 // FIXME: We should support exceptions other than DOM exceptions. |
11112 RELEASE_ASSERT_NOT_REACHED(); | 11145 RELEASE_ASSERT_NOT_REACHED(); |
11113 } | 11146 } |
11114 return false; | 11147 return false; |
11115 } | 11148 } |
11116 return true; | 11149 return true; |
11117 } | 11150 } |
11118 | 11151 |
11119 } // namespace blink | 11152 } // namespace blink |
OLD | NEW |