| 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 10580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10591 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10591 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10592 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10592 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10593 if (!scriptState->executionContext()) | 10593 if (!scriptState->executionContext()) |
| 10594 return false; | 10594 return false; |
| 10595 | 10595 |
| 10596 ScriptState::Scope scope(scriptState); | 10596 ScriptState::Scope scope(scriptState); |
| 10597 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10597 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10598 | 10598 |
| 10599 v8::Handle<v8::Value> *argv = 0; | 10599 v8::Handle<v8::Value> *argv = 0; |
| 10600 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); | 10600 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); |
| 10601 v8::TryCatch block; | 10601 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, scriptStateInUserScript, "TestObject", "voidMethodImplementedInPrivateScript"
, holder, 0, argv); |
| 10602 PrivateScriptRunner::runDOMMethod(scriptState, "TestObject", "voidMethodImpl
ementedInPrivateScript", holder, 0, argv); | 10602 if (v8Value.IsEmpty()) |
| 10603 if (block.HasCaught()) { | |
| 10604 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "voidMeth
odImplementedInPrivateScript", "TestObject"); | |
| 10605 block.ReThrow(); | |
| 10606 return false; | 10603 return false; |
| 10607 } | 10604 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10608 return true; | 10605 return true; |
| 10609 } | 10606 } |
| 10610 | 10607 |
| 10611 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
calFrame* frame, TestObject* holderImpl, int* result) | 10608 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
calFrame* frame, TestObject* holderImpl, int* result) |
| 10612 { | 10609 { |
| 10613 if (!frame) | 10610 if (!frame) |
| 10614 return false; | 10611 return false; |
| 10615 v8::HandleScope handleScope(toIsolate(frame)); | 10612 v8::HandleScope handleScope(toIsolate(frame)); |
| 10616 ScriptForbiddenScope::AllowUserAgentScript script; | 10613 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10617 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10614 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10618 if (contextInPrivateScript.IsEmpty()) | 10615 if (contextInPrivateScript.IsEmpty()) |
| 10619 return false; | 10616 return false; |
| 10620 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10617 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10621 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10618 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10622 if (!scriptState->executionContext()) | 10619 if (!scriptState->executionContext()) |
| 10623 return false; | 10620 return false; |
| 10624 | 10621 |
| 10625 ScriptState::Scope scope(scriptState); | 10622 ScriptState::Scope scope(scriptState); |
| 10626 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10623 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10627 | 10624 |
| 10628 v8::Handle<v8::Value> *argv = 0; | 10625 v8::Handle<v8::Value> *argv = 0; |
| 10629 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr
iptState->isolate()); | 10626 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr
iptState->isolate()); |
| 10630 v8::TryCatch block; | 10627 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, scriptStateInUserScript, "TestObject", "shortMethodImplementedInPrivateScript
", holder, 0, argv); |
| 10631 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodImplementedInPrivateScript", holder, 0, argv); | 10628 if (v8Value.IsEmpty()) |
| 10632 if (block.HasCaught()) { | |
| 10633 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "shortMet
hodImplementedInPrivateScript", "TestObject"); | |
| 10634 block.ReThrow(); | |
| 10635 return false; | 10629 return false; |
| 10636 } | |
| 10637 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10630 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
| 10631 *result = cppValue; |
| 10638 RELEASE_ASSERT(!exceptionState.hadException()); | 10632 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10639 *result = cppValue; | |
| 10640 return true; | 10633 return true; |
| 10641 } | 10634 } |
| 10642 | 10635 |
| 10643 bool V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPriva
teScriptMethod(LocalFrame* frame, TestObject* holderImpl, int value, int* result
) | 10636 bool V8TestObject::PrivateScript::shortMethodWithShortArgumentImplementedInPriva
teScriptMethod(LocalFrame* frame, TestObject* holderImpl, int value, int* result
) |
| 10644 { | 10637 { |
| 10645 if (!frame) | 10638 if (!frame) |
| 10646 return false; | 10639 return false; |
| 10647 v8::HandleScope handleScope(toIsolate(frame)); | 10640 v8::HandleScope handleScope(toIsolate(frame)); |
| 10648 ScriptForbiddenScope::AllowUserAgentScript script; | 10641 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10649 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10642 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10650 if (contextInPrivateScript.IsEmpty()) | 10643 if (contextInPrivateScript.IsEmpty()) |
| 10651 return false; | 10644 return false; |
| 10652 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10645 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10653 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10646 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10654 if (!scriptState->executionContext()) | 10647 if (!scriptState->executionContext()) |
| 10655 return false; | 10648 return false; |
| 10656 | 10649 |
| 10657 ScriptState::Scope scope(scriptState); | 10650 ScriptState::Scope scope(scriptState); |
| 10658 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10651 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10659 | 10652 |
| 10660 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); | 10653 v8::Handle<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); |
| 10661 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10654 v8::Handle<v8::Value> argv[] = { valueHandle }; |
| 10662 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context
()->Global(), scriptState->isolate()); | 10655 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context
()->Global(), scriptState->isolate()); |
| 10663 v8::TryCatch block; | 10656 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, scriptStateInUserScript, "TestObject", "shortMethodWithShortArgumentImplement
edInPrivateScript", holder, 1, argv); |
| 10664 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "shortMethodWithShortArgumentImplementedInPrivateScript", holde
r, 1, argv); | 10657 if (v8Value.IsEmpty()) |
| 10665 if (block.HasCaught()) { | |
| 10666 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "shortMet
hodWithShortArgumentImplementedInPrivateScript", "TestObject"); | |
| 10667 block.ReThrow(); | |
| 10668 return false; | 10658 return false; |
| 10669 } | |
| 10670 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10659 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
| 10660 *result = cppValue; |
| 10671 RELEASE_ASSERT(!exceptionState.hadException()); | 10661 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10672 *result = cppValue; | |
| 10673 return true; | 10662 return true; |
| 10674 } | 10663 } |
| 10675 | 10664 |
| 10676 bool V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPri
vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, String value, String
* result) | 10665 bool V8TestObject::PrivateScript::stringMethodWithStringArgumentImplementedInPri
vateScriptMethod(LocalFrame* frame, TestObject* holderImpl, String value, String
* result) |
| 10677 { | 10666 { |
| 10678 if (!frame) | 10667 if (!frame) |
| 10679 return false; | 10668 return false; |
| 10680 v8::HandleScope handleScope(toIsolate(frame)); | 10669 v8::HandleScope handleScope(toIsolate(frame)); |
| 10681 ScriptForbiddenScope::AllowUserAgentScript script; | 10670 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10682 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10671 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10683 if (contextInPrivateScript.IsEmpty()) | 10672 if (contextInPrivateScript.IsEmpty()) |
| 10684 return false; | 10673 return false; |
| 10685 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10674 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10686 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10675 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10687 if (!scriptState->executionContext()) | 10676 if (!scriptState->executionContext()) |
| 10688 return false; | 10677 return false; |
| 10689 | 10678 |
| 10690 ScriptState::Scope scope(scriptState); | 10679 ScriptState::Scope scope(scriptState); |
| 10691 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10680 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10692 | 10681 |
| 10693 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); | 10682 v8::Handle<v8::Value> valueHandle = v8String(scriptState->isolate(), value); |
| 10694 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10683 v8::Handle<v8::Value> argv[] = { valueHandle }; |
| 10695 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho
dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); | 10684 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho
dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
| 10696 v8::TryCatch block; | 10685 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, scriptStateInUserScript, "TestObject", "stringMethodWithStringArgumentImpleme
ntedInPrivateScript", holder, 1, argv); |
| 10697 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "stringMethodWithStringArgumentImplementedInPrivateScript", hol
der, 1, argv); | 10686 if (v8Value.IsEmpty()) |
| 10698 if (block.HasCaught()) { | |
| 10699 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "stringMe
thodWithStringArgumentImplementedInPrivateScript", "TestObject"); | |
| 10700 block.ReThrow(); | |
| 10701 return false; | 10687 return false; |
| 10702 } | |
| 10703 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 10688 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
| 10689 *result = cppValue; |
| 10704 RELEASE_ASSERT(!exceptionState.hadException()); | 10690 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10705 *result = cppValue; | |
| 10706 return true; | 10691 return true; |
| 10707 } | 10692 } |
| 10708 | 10693 |
| 10709 bool V8TestObject::PrivateScript::nodeMethodWithNodeArgumentImplementedInPrivate
ScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<N
ode> value, RefPtrWillBeRawPtr<Node>* result) | 10694 bool V8TestObject::PrivateScript::nodeMethodWithNodeArgumentImplementedInPrivate
ScriptMethod(LocalFrame* frame, TestObject* holderImpl, PassRefPtrWillBeRawPtr<N
ode> value, RefPtrWillBeRawPtr<Node>* result) |
| 10710 { | 10695 { |
| 10711 if (!frame) | 10696 if (!frame) |
| 10712 return false; | 10697 return false; |
| 10713 v8::HandleScope handleScope(toIsolate(frame)); | 10698 v8::HandleScope handleScope(toIsolate(frame)); |
| 10714 ScriptForbiddenScope::AllowUserAgentScript script; | 10699 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10715 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10700 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10716 if (contextInPrivateScript.IsEmpty()) | 10701 if (contextInPrivateScript.IsEmpty()) |
| 10717 return false; | 10702 return false; |
| 10718 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10703 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10719 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10704 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10720 if (!scriptState->executionContext()) | 10705 if (!scriptState->executionContext()) |
| 10721 return false; | 10706 return false; |
| 10722 | 10707 |
| 10723 ScriptState::Scope scope(scriptState); | 10708 ScriptState::Scope scope(scriptState); |
| 10724 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10709 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10725 | 10710 |
| 10726 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob
al(), scriptState->isolate()); | 10711 v8::Handle<v8::Value> valueHandle = toV8(value, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10727 v8::Handle<v8::Value> argv[] = { valueHandle }; | 10712 v8::Handle<v8::Value> argv[] = { valueHandle }; |
| 10728 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()
->Global(), scriptState->isolate()); | 10713 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()
->Global(), scriptState->isolate()); |
| 10729 v8::TryCatch block; | 10714 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, scriptStateInUserScript, "TestObject", "nodeMethodWithNodeArgumentImplemented
InPrivateScript", holder, 1, argv); |
| 10730 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithNodeArgumentImplementedInPrivateScript", holder,
1, argv); | 10715 if (v8Value.IsEmpty()) |
| 10731 if (block.HasCaught()) { | |
| 10732 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "nodeMeth
odWithNodeArgumentImplementedInPrivateScript", "TestObject"); | |
| 10733 block.ReThrow(); | |
| 10734 return false; | 10716 return false; |
| 10735 } | |
| 10736 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); | 10717 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); |
| 10718 *result = cppValue; |
| 10737 RELEASE_ASSERT(!exceptionState.hadException()); | 10719 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10738 *result = cppValue; | |
| 10739 return true; | 10720 return true; |
| 10740 } | 10721 } |
| 10741 | 10722 |
| 10742 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) | 10723 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) |
| 10743 { | 10724 { |
| 10744 if (!frame) | 10725 if (!frame) |
| 10745 return false; | 10726 return false; |
| 10746 v8::HandleScope handleScope(toIsolate(frame)); | 10727 v8::HandleScope handleScope(toIsolate(frame)); |
| 10747 ScriptForbiddenScope::AllowUserAgentScript script; | 10728 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10748 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10729 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10749 if (contextInPrivateScript.IsEmpty()) | 10730 if (contextInPrivateScript.IsEmpty()) |
| 10750 return false; | 10731 return false; |
| 10751 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10732 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10752 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10733 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10753 if (!scriptState->executionContext()) | 10734 if (!scriptState->executionContext()) |
| 10754 return false; | 10735 return false; |
| 10755 | 10736 |
| 10756 ScriptState::Scope scope(scriptState); | 10737 ScriptState::Scope scope(scriptState); |
| 10757 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10738 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10758 | 10739 |
| 10759 v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()
->Global(), scriptState->isolate()); | 10740 v8::Handle<v8::Value> documentHandle = toV8(document, scriptState->context()
->Global(), scriptState->isolate()); |
| 10760 v8::Handle<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global
(), scriptState->isolate()); | 10741 v8::Handle<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global
(), scriptState->isolate()); |
| 10761 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); | 10742 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); |
| 10762 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(),
value2); | 10743 v8::Handle<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(),
value2); |
| 10763 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string
); | 10744 v8::Handle<v8::Value> stringHandle = v8String(scriptState->isolate(), string
); |
| 10764 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v
alue2Handle, stringHandle }; | 10745 v8::Handle<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, v
alue2Handle, stringHandle }; |
| 10765 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); | 10746 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
| 10766 v8::TryCatch block; | 10747 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, scriptStateInUserScript, "TestObject", "nodeMethodWithVariousArgumentsImpleme
ntedInPrivateScript", holder, 5, argv); |
| 10767 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "nodeMethodWithVariousArgumentsImplementedInPrivateScript", hol
der, 5, argv); | 10748 if (v8Value.IsEmpty()) |
| 10768 if (block.HasCaught()) { | |
| 10769 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "nodeMeth
odWithVariousArgumentsImplementedInPrivateScript", "TestObject"); | |
| 10770 block.ReThrow(); | |
| 10771 return false; | 10749 return false; |
| 10772 } | |
| 10773 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); | 10750 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); |
| 10751 *result = cppValue; |
| 10774 RELEASE_ASSERT(!exceptionState.hadException()); | 10752 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10775 *result = cppValue; | |
| 10776 return true; | 10753 return true; |
| 10777 } | 10754 } |
| 10778 | 10755 |
| 10779 bool V8TestObject::PrivateScript::methodForPrivateScriptOnlyMethod(LocalFrame* f
rame, TestObject* holderImpl, int value1, int value2, int* result) | 10756 bool V8TestObject::PrivateScript::methodForPrivateScriptOnlyMethod(LocalFrame* f
rame, TestObject* holderImpl, int value1, int value2, int* result) |
| 10780 { | 10757 { |
| 10781 if (!frame) | 10758 if (!frame) |
| 10782 return false; | 10759 return false; |
| 10783 v8::HandleScope handleScope(toIsolate(frame)); | 10760 v8::HandleScope handleScope(toIsolate(frame)); |
| 10784 ScriptForbiddenScope::AllowUserAgentScript script; | 10761 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10785 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10762 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10786 if (contextInPrivateScript.IsEmpty()) | 10763 if (contextInPrivateScript.IsEmpty()) |
| 10787 return false; | 10764 return false; |
| 10788 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10765 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10789 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10766 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10790 if (!scriptState->executionContext()) | 10767 if (!scriptState->executionContext()) |
| 10791 return false; | 10768 return false; |
| 10792 | 10769 |
| 10793 ScriptState::Scope scope(scriptState); | 10770 ScriptState::Scope scope(scriptState); |
| 10794 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()); |
| 10795 | 10772 |
| 10796 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); | 10773 v8::Handle<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate()
, value1); |
| 10797 v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate()
, value2); | 10774 v8::Handle<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate()
, value2); |
| 10798 v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle }; | 10775 v8::Handle<v8::Value> argv[] = { value1Handle, value2Handle }; |
| 10799 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 10776 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
| 10800 v8::TryCatch block; | 10777 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, scriptStateInUserScript, "TestObject", "methodForPrivateScriptOnly", holder,
2, argv); |
| 10801 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptStat
e, "TestObject", "methodForPrivateScriptOnly", holder, 2, argv); | 10778 if (v8Value.IsEmpty()) |
| 10802 if (block.HasCaught()) { | |
| 10803 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::ExecutionContext, "methodFo
rPrivateScriptOnly", "TestObject"); | |
| 10804 block.ReThrow(); | |
| 10805 return false; | 10779 return false; |
| 10806 } | |
| 10807 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10780 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
| 10781 *result = cppValue; |
| 10808 RELEASE_ASSERT(!exceptionState.hadException()); | 10782 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10809 *result = cppValue; | |
| 10810 return true; | 10783 return true; |
| 10811 } | 10784 } |
| 10812 | 10785 |
| 10813 bool V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(LocalFra
me* frame, TestObject* holderImpl, int* result) | 10786 bool V8TestObject::PrivateScript::readonlyShortAttributeAttributeGetter(LocalFra
me* frame, TestObject* holderImpl, int* result) |
| 10814 { | 10787 { |
| 10815 if (!frame) | 10788 if (!frame) |
| 10816 return false; | 10789 return false; |
| 10817 v8::HandleScope handleScope(toIsolate(frame)); | 10790 v8::HandleScope handleScope(toIsolate(frame)); |
| 10818 ScriptForbiddenScope::AllowUserAgentScript script; | 10791 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10819 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10792 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10820 if (contextInPrivateScript.IsEmpty()) | 10793 if (contextInPrivateScript.IsEmpty()) |
| 10821 return false; | 10794 return false; |
| 10822 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10795 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10823 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10796 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10824 if (!scriptState->executionContext()) | 10797 if (!scriptState->executionContext()) |
| 10825 return false; | 10798 return false; |
| 10826 | 10799 |
| 10827 ScriptState::Scope scope(scriptState); | 10800 ScriptState::Scope scope(scriptState); |
| 10828 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10801 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10829 | 10802 |
| 10830 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA
ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate(
)); | 10803 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA
ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate(
)); |
| 10831 v8::TryCatch block; | 10804 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, scriptStateInUserScript, "TestObject", "readonlyShortAttribute", hol
der); |
| 10832 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "readonlyShortAttribute", holder); | 10805 if (v8Value.IsEmpty()) |
| 10833 if (block.HasCaught()) { | |
| 10834 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::GetterContext, "readonlySho
rtAttribute", "TestObject"); | |
| 10835 block.ReThrow(); | |
| 10836 return false; | 10806 return false; |
| 10837 } | |
| 10838 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10807 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
| 10839 RELEASE_ASSERT(!exceptionState.hadException()); | 10808 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10840 *result = cppValue; | 10809 *result = cppValue; |
| 10841 return true; | 10810 return true; |
| 10842 } | 10811 } |
| 10843 | 10812 |
| 10844 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
e, TestObject* holderImpl, int* result) | 10813 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
e, TestObject* holderImpl, int* result) |
| 10845 { | 10814 { |
| 10846 if (!frame) | 10815 if (!frame) |
| 10847 return false; | 10816 return false; |
| 10848 v8::HandleScope handleScope(toIsolate(frame)); | 10817 v8::HandleScope handleScope(toIsolate(frame)); |
| 10849 ScriptForbiddenScope::AllowUserAgentScript script; | 10818 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10850 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10819 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10851 if (contextInPrivateScript.IsEmpty()) | 10820 if (contextInPrivateScript.IsEmpty()) |
| 10852 return false; | 10821 return false; |
| 10853 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10822 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10854 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10823 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10855 if (!scriptState->executionContext()) | 10824 if (!scriptState->executionContext()) |
| 10856 return false; | 10825 return false; |
| 10857 | 10826 |
| 10858 ScriptState::Scope scope(scriptState); | 10827 ScriptState::Scope scope(scriptState); |
| 10859 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10828 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10860 | 10829 |
| 10861 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 10830 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 10862 v8::TryCatch block; | 10831 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder); |
| 10863 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "shortAttribute", holder); | 10832 if (v8Value.IsEmpty()) |
| 10864 if (block.HasCaught()) { | |
| 10865 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::GetterContext, "shortAttrib
ute", "TestObject"); | |
| 10866 block.ReThrow(); | |
| 10867 return false; | 10833 return false; |
| 10868 } | |
| 10869 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); | 10834 TONATIVE_DEFAULT_EXCEPTIONSTATE(int, cppValue, toInt16(v8Value, exceptionSta
te), exceptionState, false); |
| 10870 RELEASE_ASSERT(!exceptionState.hadException()); | 10835 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10871 *result = cppValue; | 10836 *result = cppValue; |
| 10872 return true; | 10837 return true; |
| 10873 } | 10838 } |
| 10874 | 10839 |
| 10875 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram
e, TestObject* holderImpl, int cppValue) | 10840 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram
e, TestObject* holderImpl, int cppValue) |
| 10876 { | 10841 { |
| 10877 if (!frame) | 10842 if (!frame) |
| 10878 return false; | 10843 return false; |
| 10879 v8::HandleScope handleScope(toIsolate(frame)); | 10844 v8::HandleScope handleScope(toIsolate(frame)); |
| 10880 ScriptForbiddenScope::AllowUserAgentScript script; | 10845 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10881 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10846 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10882 if (contextInPrivateScript.IsEmpty()) | 10847 if (contextInPrivateScript.IsEmpty()) |
| 10883 return false; | 10848 return false; |
| 10884 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10849 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10885 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10850 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10886 if (!scriptState->executionContext()) | 10851 if (!scriptState->executionContext()) |
| 10887 return false; | 10852 return false; |
| 10888 | 10853 |
| 10889 ScriptState::Scope scope(scriptState); | 10854 ScriptState::Scope scope(scriptState); |
| 10890 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10855 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10891 | 10856 |
| 10892 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 10857 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 10893 v8::TryCatch block; | 10858 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "shortAttribute", holder, v8::Integer::New(scriptState
->isolate(), cppValue)); |
| 10894 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "short
Attribute", holder, v8::Integer::New(scriptState->isolate(), cppValue)); | |
| 10895 if (block.HasCaught()) { | |
| 10896 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::SetterContext, "shortAttrib
ute", "TestObject"); | |
| 10897 block.ReThrow(); | |
| 10898 return false; | |
| 10899 } | |
| 10900 return true; | |
| 10901 } | 10859 } |
| 10902 | 10860 |
| 10903 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
me, TestObject* holderImpl, String* result) | 10861 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
me, TestObject* holderImpl, String* result) |
| 10904 { | 10862 { |
| 10905 if (!frame) | 10863 if (!frame) |
| 10906 return false; | 10864 return false; |
| 10907 v8::HandleScope handleScope(toIsolate(frame)); | 10865 v8::HandleScope handleScope(toIsolate(frame)); |
| 10908 ScriptForbiddenScope::AllowUserAgentScript script; | 10866 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10909 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10867 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10910 if (contextInPrivateScript.IsEmpty()) | 10868 if (contextInPrivateScript.IsEmpty()) |
| 10911 return false; | 10869 return false; |
| 10912 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10870 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10913 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10871 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10914 if (!scriptState->executionContext()) | 10872 if (!scriptState->executionContext()) |
| 10915 return false; | 10873 return false; |
| 10916 | 10874 |
| 10917 ScriptState::Scope scope(scriptState); | 10875 ScriptState::Scope scope(scriptState); |
| 10918 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10876 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10919 | 10877 |
| 10920 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 10878 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 10921 v8::TryCatch block; | 10879 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder); |
| 10922 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "stringAttribute", holder); | 10880 if (v8Value.IsEmpty()) |
| 10923 if (block.HasCaught()) { | |
| 10924 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::GetterContext, "stringAttri
bute", "TestObject"); | |
| 10925 block.ReThrow(); | |
| 10926 return false; | 10881 return false; |
| 10927 } | |
| 10928 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 10882 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
| 10929 RELEASE_ASSERT(!exceptionState.hadException()); | 10883 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10930 *result = cppValue; | 10884 *result = cppValue; |
| 10931 return true; | 10885 return true; |
| 10932 } | 10886 } |
| 10933 | 10887 |
| 10934 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra
me, TestObject* holderImpl, String cppValue) | 10888 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra
me, TestObject* holderImpl, String cppValue) |
| 10935 { | 10889 { |
| 10936 if (!frame) | 10890 if (!frame) |
| 10937 return false; | 10891 return false; |
| 10938 v8::HandleScope handleScope(toIsolate(frame)); | 10892 v8::HandleScope handleScope(toIsolate(frame)); |
| 10939 ScriptForbiddenScope::AllowUserAgentScript script; | 10893 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10940 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10894 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10941 if (contextInPrivateScript.IsEmpty()) | 10895 if (contextInPrivateScript.IsEmpty()) |
| 10942 return false; | 10896 return false; |
| 10943 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10897 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10944 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10898 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10945 if (!scriptState->executionContext()) | 10899 if (!scriptState->executionContext()) |
| 10946 return false; | 10900 return false; |
| 10947 | 10901 |
| 10948 ScriptState::Scope scope(scriptState); | 10902 ScriptState::Scope scope(scriptState); |
| 10949 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10903 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10950 | 10904 |
| 10951 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 10905 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 10952 v8::TryCatch block; | 10906 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "stringAttribute", holder, v8String(scriptState->isola
te(), cppValue)); |
| 10953 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "strin
gAttribute", holder, v8String(scriptState->isolate(), cppValue)); | |
| 10954 if (block.HasCaught()) { | |
| 10955 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::SetterContext, "stringAttri
bute", "TestObject"); | |
| 10956 block.ReThrow(); | |
| 10957 return false; | |
| 10958 } | |
| 10959 return true; | |
| 10960 } | 10907 } |
| 10961 | 10908 |
| 10962 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame
, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) | 10909 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame
, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) |
| 10963 { | 10910 { |
| 10964 if (!frame) | 10911 if (!frame) |
| 10965 return false; | 10912 return false; |
| 10966 v8::HandleScope handleScope(toIsolate(frame)); | 10913 v8::HandleScope handleScope(toIsolate(frame)); |
| 10967 ScriptForbiddenScope::AllowUserAgentScript script; | 10914 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10968 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10915 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 10969 if (contextInPrivateScript.IsEmpty()) | 10916 if (contextInPrivateScript.IsEmpty()) |
| 10970 return false; | 10917 return false; |
| 10971 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10918 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 10972 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10919 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 10973 if (!scriptState->executionContext()) | 10920 if (!scriptState->executionContext()) |
| 10974 return false; | 10921 return false; |
| 10975 | 10922 |
| 10976 ScriptState::Scope scope(scriptState); | 10923 ScriptState::Scope scope(scriptState); |
| 10977 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10924 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 10978 | 10925 |
| 10979 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 10926 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 10980 v8::TryCatch block; | 10927 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder); |
| 10981 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "nodeAttribute", holder); | 10928 if (v8Value.IsEmpty()) |
| 10982 if (block.HasCaught()) { | |
| 10983 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::GetterContext, "nodeAttribu
te", "TestObject"); | |
| 10984 block.ReThrow(); | |
| 10985 return false; | 10929 return false; |
| 10986 } | |
| 10987 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); | 10930 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); |
| 10988 RELEASE_ASSERT(!exceptionState.hadException()); | 10931 RELEASE_ASSERT(!exceptionState.hadException()); |
| 10989 *result = cppValue; | 10932 *result = cppValue; |
| 10990 return true; | 10933 return true; |
| 10991 } | 10934 } |
| 10992 | 10935 |
| 10993 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame
, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) | 10936 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame
, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) |
| 10994 { | 10937 { |
| 10995 if (!frame) | 10938 if (!frame) |
| 10996 return false; | 10939 return false; |
| 10997 v8::HandleScope handleScope(toIsolate(frame)); | 10940 v8::HandleScope handleScope(toIsolate(frame)); |
| 10998 ScriptForbiddenScope::AllowUserAgentScript script; | 10941 ScriptForbiddenScope::AllowUserAgentScript script; |
| 10999 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10942 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 11000 if (contextInPrivateScript.IsEmpty()) | 10943 if (contextInPrivateScript.IsEmpty()) |
| 11001 return false; | 10944 return false; |
| 11002 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10945 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 11003 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10946 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 11004 if (!scriptState->executionContext()) | 10947 if (!scriptState->executionContext()) |
| 11005 return false; | 10948 return false; |
| 11006 | 10949 |
| 11007 ScriptState::Scope scope(scriptState); | 10950 ScriptState::Scope scope(scriptState); |
| 11008 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10951 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 11009 | 10952 |
| 11010 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 10953 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 11011 v8::TryCatch block; | 10954 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "nodeAttribute", holder, toV8(cppValue, scriptState->c
ontext()->Global(), scriptState->isolate())); |
| 11012 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "nodeA
ttribute", holder, toV8(cppValue, scriptState->context()->Global(), scriptState-
>isolate())); | |
| 11013 if (block.HasCaught()) { | |
| 11014 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::SetterContext, "nodeAttribu
te", "TestObject"); | |
| 11015 block.ReThrow(); | |
| 11016 return false; | |
| 11017 } | |
| 11018 return true; | |
| 11019 } | 10955 } |
| 11020 | 10956 |
| 11021 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
ocalFrame* frame, TestObject* holderImpl, String* result) | 10957 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
ocalFrame* frame, TestObject* holderImpl, String* result) |
| 11022 { | 10958 { |
| 11023 if (!frame) | 10959 if (!frame) |
| 11024 return false; | 10960 return false; |
| 11025 v8::HandleScope handleScope(toIsolate(frame)); | 10961 v8::HandleScope handleScope(toIsolate(frame)); |
| 11026 ScriptForbiddenScope::AllowUserAgentScript script; | 10962 ScriptForbiddenScope::AllowUserAgentScript script; |
| 11027 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10963 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 11028 if (contextInPrivateScript.IsEmpty()) | 10964 if (contextInPrivateScript.IsEmpty()) |
| 11029 return false; | 10965 return false; |
| 11030 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10966 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 11031 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10967 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 11032 if (!scriptState->executionContext()) | 10968 if (!scriptState->executionContext()) |
| 11033 return false; | 10969 return false; |
| 11034 | 10970 |
| 11035 ScriptState::Scope scope(scriptState); | 10971 ScriptState::Scope scope(scriptState); |
| 11036 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10972 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 11037 | 10973 |
| 11038 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 10974 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
| 11039 v8::TryCatch block; | 10975 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnl
y", holder); |
| 11040 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "attributeForPrivateScriptOnly", holder); | 10976 if (v8Value.IsEmpty()) |
| 11041 if (block.HasCaught()) { | |
| 11042 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::GetterContext, "attributeFo
rPrivateScriptOnly", "TestObject"); | |
| 11043 block.ReThrow(); | |
| 11044 return false; | 10977 return false; |
| 11045 } | |
| 11046 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 10978 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
| 11047 RELEASE_ASSERT(!exceptionState.hadException()); | 10979 RELEASE_ASSERT(!exceptionState.hadException()); |
| 11048 *result = cppValue; | 10980 *result = cppValue; |
| 11049 return true; | 10981 return true; |
| 11050 } | 10982 } |
| 11051 | 10983 |
| 11052 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L
ocalFrame* frame, TestObject* holderImpl, String cppValue) | 10984 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L
ocalFrame* frame, TestObject* holderImpl, String cppValue) |
| 11053 { | 10985 { |
| 11054 if (!frame) | 10986 if (!frame) |
| 11055 return false; | 10987 return false; |
| 11056 v8::HandleScope handleScope(toIsolate(frame)); | 10988 v8::HandleScope handleScope(toIsolate(frame)); |
| 11057 ScriptForbiddenScope::AllowUserAgentScript script; | 10989 ScriptForbiddenScope::AllowUserAgentScript script; |
| 11058 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 10990 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 11059 if (contextInPrivateScript.IsEmpty()) | 10991 if (contextInPrivateScript.IsEmpty()) |
| 11060 return false; | 10992 return false; |
| 11061 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 10993 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 11062 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 10994 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 11063 if (!scriptState->executionContext()) | 10995 if (!scriptState->executionContext()) |
| 11064 return false; | 10996 return false; |
| 11065 | 10997 |
| 11066 ScriptState::Scope scope(scriptState); | 10998 ScriptState::Scope scope(scriptState); |
| 11067 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 10999 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 11068 | 11000 |
| 11069 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 11001 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
| 11070 v8::TryCatch block; | 11002 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "attributeForPrivateScriptOnly", holder, v8String(scri
ptState->isolate(), cppValue)); |
| 11071 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "attri
buteForPrivateScriptOnly", holder, v8String(scriptState->isolate(), cppValue)); | |
| 11072 if (block.HasCaught()) { | |
| 11073 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::SetterContext, "attributeFo
rPrivateScriptOnly", "TestObject"); | |
| 11074 block.ReThrow(); | |
| 11075 return false; | |
| 11076 } | |
| 11077 return true; | |
| 11078 } | 11003 } |
| 11079 | 11004 |
| 11080 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame
* frame, TestObject* holderImpl, String* result) | 11005 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame
* frame, TestObject* holderImpl, String* result) |
| 11081 { | 11006 { |
| 11082 if (!frame) | 11007 if (!frame) |
| 11083 return false; | 11008 return false; |
| 11084 v8::HandleScope handleScope(toIsolate(frame)); | 11009 v8::HandleScope handleScope(toIsolate(frame)); |
| 11085 ScriptForbiddenScope::AllowUserAgentScript script; | 11010 ScriptForbiddenScope::AllowUserAgentScript script; |
| 11086 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 11011 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 11087 if (contextInPrivateScript.IsEmpty()) | 11012 if (contextInPrivateScript.IsEmpty()) |
| 11088 return false; | 11013 return false; |
| 11089 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 11014 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 11090 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 11015 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 11091 if (!scriptState->executionContext()) | 11016 if (!scriptState->executionContext()) |
| 11092 return false; | 11017 return false; |
| 11093 | 11018 |
| 11094 ScriptState::Scope scope(scriptState); | 11019 ScriptState::Scope scope(scriptState); |
| 11095 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11020 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 11096 | 11021 |
| 11097 ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; | 11022 ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; |
| 11098 v8::TryCatch block; | 11023 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holde
r); |
| 11099 v8::Handle<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(s
criptState, "TestObject", "enumForPrivateScript", holder); | 11024 if (v8Value.IsEmpty()) |
| 11100 if (block.HasCaught()) { | |
| 11101 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::GetterContext, "enumForPriv
ateScript", "TestObject"); | |
| 11102 block.ReThrow(); | |
| 11103 return false; | 11025 return false; |
| 11104 } | |
| 11105 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); | 11026 TOSTRING_DEFAULT(V8StringResource<>, cppValue, v8Value, false); |
| 11106 RELEASE_ASSERT(!exceptionState.hadException()); | 11027 RELEASE_ASSERT(!exceptionState.hadException()); |
| 11107 *result = cppValue; | 11028 *result = cppValue; |
| 11108 return true; | 11029 return true; |
| 11109 } | 11030 } |
| 11110 | 11031 |
| 11111 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame
* frame, TestObject* holderImpl, String cppValue) | 11032 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame
* frame, TestObject* holderImpl, String cppValue) |
| 11112 { | 11033 { |
| 11113 if (!frame) | 11034 if (!frame) |
| 11114 return false; | 11035 return false; |
| 11115 v8::HandleScope handleScope(toIsolate(frame)); | 11036 v8::HandleScope handleScope(toIsolate(frame)); |
| 11116 ScriptForbiddenScope::AllowUserAgentScript script; | 11037 ScriptForbiddenScope::AllowUserAgentScript script; |
| 11117 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); | 11038 v8::Handle<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrapp
erWorld::privateScriptIsolatedWorld()); |
| 11118 if (contextInPrivateScript.IsEmpty()) | 11039 if (contextInPrivateScript.IsEmpty()) |
| 11119 return false; | 11040 return false; |
| 11120 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 11041 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 11121 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 11042 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 11122 if (!scriptState->executionContext()) | 11043 if (!scriptState->executionContext()) |
| 11123 return false; | 11044 return false; |
| 11124 | 11045 |
| 11125 ScriptState::Scope scope(scriptState); | 11046 ScriptState::Scope scope(scriptState); |
| 11126 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); | 11047 v8::Handle<v8::Value> holder = toV8(holderImpl, scriptState->context()->Glob
al(), scriptState->isolate()); |
| 11127 | 11048 |
| 11128 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; | 11049 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; |
| 11129 v8::TryCatch block; | 11050 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->
isolate(), cppValue)); |
| 11130 PrivateScriptRunner::runDOMAttributeSetter(scriptState, "TestObject", "enumF
orPrivateScript", holder, v8String(scriptState->isolate(), cppValue)); | |
| 11131 if (block.HasCaught()) { | |
| 11132 PrivateScriptRunner::rethrowExceptionInPrivateScript(scriptState->isolat
e(), block, scriptStateInUserScript, ExceptionState::SetterContext, "enumForPriv
ateScript", "TestObject"); | |
| 11133 block.ReThrow(); | |
| 11134 return false; | |
| 11135 } | |
| 11136 return true; | |
| 11137 } | 11051 } |
| 11138 | 11052 |
| 11139 } // namespace blink | 11053 } // namespace blink |
| OLD | NEW |