| 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 12974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 12985 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 12985 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 12986 if (contextInPrivateScript.IsEmpty()) | 12986 if (contextInPrivateScript.IsEmpty()) |
| 12987 return false; | 12987 return false; |
| 12988 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 12988 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 12989 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 12989 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 12990 if (!scriptState->executionContext()) | 12990 if (!scriptState->executionContext()) |
| 12991 return false; | 12991 return false; |
| 12992 | 12992 |
| 12993 ScriptState::Scope scope(scriptState); | 12993 ScriptState::Scope scope(scriptState); |
| 12994 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 12994 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 12995 if (holder.IsEmpty()) |
| 12996 return false; |
| 12995 | 12997 |
| 12996 v8::Local<v8::Value> *argv = 0; | 12998 v8::Local<v8::Value> *argv = 0; |
| 12997 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); | 12999 ExceptionState exceptionState(ExceptionState::ExecutionContext, "voidMethodI
mplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scri
ptState->isolate()); |
| 12998 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "voidMethodImplementedInPrivateScript",
holder, 0, argv); | 13000 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "voidMethodImplementedInPrivateScript",
holder, 0, argv); |
| 12999 if (v8Value.IsEmpty()) | 13001 if (v8Value.IsEmpty()) |
| 13000 return false; | 13002 return false; |
| 13001 RELEASE_ASSERT(!exceptionState.hadException()); | 13003 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13002 return true; | 13004 return true; |
| 13003 } | 13005 } |
| 13004 | 13006 |
| 13005 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
calFrame* frame, TestObject* holderImpl, int* result) | 13007 bool V8TestObject::PrivateScript::shortMethodImplementedInPrivateScriptMethod(Lo
calFrame* frame, TestObject* holderImpl, int* result) |
| 13006 { | 13008 { |
| 13007 if (!frame) | 13009 if (!frame) |
| 13008 return false; | 13010 return false; |
| 13009 v8::HandleScope handleScope(toIsolate(frame)); | 13011 v8::HandleScope handleScope(toIsolate(frame)); |
| 13010 ScriptForbiddenScope::AllowUserAgentScript script; | 13012 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13011 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13013 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13012 if (contextInPrivateScript.IsEmpty()) | 13014 if (contextInPrivateScript.IsEmpty()) |
| 13013 return false; | 13015 return false; |
| 13014 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13016 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13015 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13017 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13016 if (!scriptState->executionContext()) | 13018 if (!scriptState->executionContext()) |
| 13017 return false; | 13019 return false; |
| 13018 | 13020 |
| 13019 ScriptState::Scope scope(scriptState); | 13021 ScriptState::Scope scope(scriptState); |
| 13020 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13022 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13023 if (holder.IsEmpty()) |
| 13024 return false; |
| 13021 | 13025 |
| 13022 v8::Local<v8::Value> *argv = 0; | 13026 v8::Local<v8::Value> *argv = 0; |
| 13023 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr
iptState->isolate()); | 13027 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
ImplementedInPrivateScript", "TestObject", scriptState->context()->Global(), scr
iptState->isolate()); |
| 13024 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "shortMethodImplementedInPrivateScript"
, holder, 0, argv); | 13028 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "shortMethodImplementedInPrivateScript"
, holder, 0, argv); |
| 13025 if (v8Value.IsEmpty()) | 13029 if (v8Value.IsEmpty()) |
| 13026 return false; | 13030 return false; |
| 13027 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); | 13031 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); |
| 13028 if (exceptionState.throwIfNeeded()) | 13032 if (exceptionState.throwIfNeeded()) |
| 13029 return false; | 13033 return false; |
| 13030 *result = cppValue; | 13034 *result = cppValue; |
| (...skipping 10 matching lines...) Expand all Loading... |
| 13041 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13045 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13042 if (contextInPrivateScript.IsEmpty()) | 13046 if (contextInPrivateScript.IsEmpty()) |
| 13043 return false; | 13047 return false; |
| 13044 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13048 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13045 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13049 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13046 if (!scriptState->executionContext()) | 13050 if (!scriptState->executionContext()) |
| 13047 return false; | 13051 return false; |
| 13048 | 13052 |
| 13049 ScriptState::Scope scope(scriptState); | 13053 ScriptState::Scope scope(scriptState); |
| 13050 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13054 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13055 if (holder.IsEmpty()) |
| 13056 return false; |
| 13051 | 13057 |
| 13052 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); | 13058 v8::Local<v8::Value> valueHandle = v8::Integer::New(scriptState->isolate(),
value); |
| 13053 v8::Local<v8::Value> argv[] = { valueHandle }; | 13059 v8::Local<v8::Value> argv[] = { valueHandle }; |
| 13054 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context
()->Global(), scriptState->isolate()); | 13060 ExceptionState exceptionState(ExceptionState::ExecutionContext, "shortMethod
WithShortArgumentImplementedInPrivateScript", "TestObject", scriptState->context
()->Global(), scriptState->isolate()); |
| 13055 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "shortMethodWithShortArgumentImplemente
dInPrivateScript", holder, 1, argv); | 13061 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "shortMethodWithShortArgumentImplemente
dInPrivateScript", holder, 1, argv); |
| 13056 if (v8Value.IsEmpty()) | 13062 if (v8Value.IsEmpty()) |
| 13057 return false; | 13063 return false; |
| 13058 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); | 13064 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); |
| 13059 if (exceptionState.throwIfNeeded()) | 13065 if (exceptionState.throwIfNeeded()) |
| 13060 return false; | 13066 return false; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 13072 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13078 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13073 if (contextInPrivateScript.IsEmpty()) | 13079 if (contextInPrivateScript.IsEmpty()) |
| 13074 return false; | 13080 return false; |
| 13075 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13081 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13076 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13082 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13077 if (!scriptState->executionContext()) | 13083 if (!scriptState->executionContext()) |
| 13078 return false; | 13084 return false; |
| 13079 | 13085 |
| 13080 ScriptState::Scope scope(scriptState); | 13086 ScriptState::Scope scope(scriptState); |
| 13081 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13087 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13088 if (holder.IsEmpty()) |
| 13089 return false; |
| 13082 | 13090 |
| 13083 v8::Local<v8::Value> valueHandle = v8String(scriptState->isolate(), value); | 13091 v8::Local<v8::Value> valueHandle = v8String(scriptState->isolate(), value); |
| 13084 v8::Local<v8::Value> argv[] = { valueHandle }; | 13092 v8::Local<v8::Value> argv[] = { valueHandle }; |
| 13085 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho
dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); | 13093 ExceptionState exceptionState(ExceptionState::ExecutionContext, "stringMetho
dWithStringArgumentImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
| 13086 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "stringMethodWithStringArgumentImplemen
tedInPrivateScript", holder, 1, argv); | 13094 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "stringMethodWithStringArgumentImplemen
tedInPrivateScript", holder, 1, argv); |
| 13087 if (v8Value.IsEmpty()) | 13095 if (v8Value.IsEmpty()) |
| 13088 return false; | 13096 return false; |
| 13089 V8StringResource<> cppValue = v8Value; | 13097 V8StringResource<> cppValue = v8Value; |
| 13090 if (!cppValue.prepare()) | 13098 if (!cppValue.prepare()) |
| 13091 return false; | 13099 return false; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 13103 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13111 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13104 if (contextInPrivateScript.IsEmpty()) | 13112 if (contextInPrivateScript.IsEmpty()) |
| 13105 return false; | 13113 return false; |
| 13106 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13114 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13107 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13115 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13108 if (!scriptState->executionContext()) | 13116 if (!scriptState->executionContext()) |
| 13109 return false; | 13117 return false; |
| 13110 | 13118 |
| 13111 ScriptState::Scope scope(scriptState); | 13119 ScriptState::Scope scope(scriptState); |
| 13112 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13120 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13121 if (holder.IsEmpty()) |
| 13122 return false; |
| 13113 | 13123 |
| 13114 v8::Local<v8::Value> valueHandle = toV8(value, scriptState->context()->Globa
l(), scriptState->isolate()); | 13124 v8::Local<v8::Value> valueHandle = toV8(value, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13115 v8::Local<v8::Value> argv[] = { valueHandle }; | 13125 v8::Local<v8::Value> argv[] = { valueHandle }; |
| 13116 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()
->Global(), scriptState->isolate()); | 13126 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithNodeArgumentImplementedInPrivateScript", "TestObject", scriptState->context()
->Global(), scriptState->isolate()); |
| 13117 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "nodeMethodWithNodeArgumentImplementedI
nPrivateScript", holder, 1, argv); | 13127 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "nodeMethodWithNodeArgumentImplementedI
nPrivateScript", holder, 1, argv); |
| 13118 if (v8Value.IsEmpty()) | 13128 if (v8Value.IsEmpty()) |
| 13119 return false; | 13129 return false; |
| 13120 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); | 13130 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); |
| 13121 *result = cppValue; | 13131 *result = cppValue; |
| 13122 RELEASE_ASSERT(!exceptionState.hadException()); | 13132 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13123 return true; | 13133 return true; |
| 13124 } | 13134 } |
| 13125 | 13135 |
| 13126 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) | 13136 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) |
| 13127 { | 13137 { |
| 13128 if (!frame) | 13138 if (!frame) |
| 13129 return false; | 13139 return false; |
| 13130 v8::HandleScope handleScope(toIsolate(frame)); | 13140 v8::HandleScope handleScope(toIsolate(frame)); |
| 13131 ScriptForbiddenScope::AllowUserAgentScript script; | 13141 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13132 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13142 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13133 if (contextInPrivateScript.IsEmpty()) | 13143 if (contextInPrivateScript.IsEmpty()) |
| 13134 return false; | 13144 return false; |
| 13135 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13145 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13136 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13146 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13137 if (!scriptState->executionContext()) | 13147 if (!scriptState->executionContext()) |
| 13138 return false; | 13148 return false; |
| 13139 | 13149 |
| 13140 ScriptState::Scope scope(scriptState); | 13150 ScriptState::Scope scope(scriptState); |
| 13141 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13151 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13152 if (holder.IsEmpty()) |
| 13153 return false; |
| 13142 | 13154 |
| 13143 v8::Local<v8::Value> documentHandle = toV8(document, scriptState->context()-
>Global(), scriptState->isolate()); | 13155 v8::Local<v8::Value> documentHandle = toV8(document, scriptState->context()-
>Global(), scriptState->isolate()); |
| 13144 v8::Local<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global(
), scriptState->isolate()); | 13156 v8::Local<v8::Value> nodeHandle = toV8(node, scriptState->context()->Global(
), scriptState->isolate()); |
| 13145 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(),
value1); | 13157 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(),
value1); |
| 13146 v8::Local<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(),
value2); | 13158 v8::Local<v8::Value> value2Handle = v8::Number::New(scriptState->isolate(),
value2); |
| 13147 v8::Local<v8::Value> stringHandle = v8String(scriptState->isolate(), string)
; | 13159 v8::Local<v8::Value> stringHandle = v8String(scriptState->isolate(), string)
; |
| 13148 v8::Local<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, va
lue2Handle, stringHandle }; | 13160 v8::Local<v8::Value> argv[] = { documentHandle, nodeHandle, value1Handle, va
lue2Handle, stringHandle }; |
| 13149 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); | 13161 ExceptionState exceptionState(ExceptionState::ExecutionContext, "nodeMethodW
ithVariousArgumentsImplementedInPrivateScript", "TestObject", scriptState->conte
xt()->Global(), scriptState->isolate()); |
| 13150 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "nodeMethodWithVariousArgumentsImplemen
tedInPrivateScript", holder, 5, argv); | 13162 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "nodeMethodWithVariousArgumentsImplemen
tedInPrivateScript", holder, 5, argv); |
| 13151 if (v8Value.IsEmpty()) | 13163 if (v8Value.IsEmpty()) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 13165 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13177 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13166 if (contextInPrivateScript.IsEmpty()) | 13178 if (contextInPrivateScript.IsEmpty()) |
| 13167 return false; | 13179 return false; |
| 13168 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13180 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13169 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13181 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13170 if (!scriptState->executionContext()) | 13182 if (!scriptState->executionContext()) |
| 13171 return false; | 13183 return false; |
| 13172 | 13184 |
| 13173 ScriptState::Scope scope(scriptState); | 13185 ScriptState::Scope scope(scriptState); |
| 13174 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13186 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13187 if (holder.IsEmpty()) |
| 13188 return false; |
| 13175 | 13189 |
| 13176 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(),
value1); | 13190 v8::Local<v8::Value> value1Handle = v8::Integer::New(scriptState->isolate(),
value1); |
| 13177 v8::Local<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate(),
value2); | 13191 v8::Local<v8::Value> value2Handle = v8::Integer::New(scriptState->isolate(),
value2); |
| 13178 v8::Local<v8::Value> argv[] = { value1Handle, value2Handle }; | 13192 v8::Local<v8::Value> argv[] = { value1Handle, value2Handle }; |
| 13179 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 13193 ExceptionState exceptionState(ExceptionState::ExecutionContext, "methodForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
| 13180 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "methodForPrivateScriptOnly", holder, 2
, argv); | 13194 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMMethod(scriptState
, scriptStateInUserScript, "TestObject", "methodForPrivateScriptOnly", holder, 2
, argv); |
| 13181 if (v8Value.IsEmpty()) | 13195 if (v8Value.IsEmpty()) |
| 13182 return false; | 13196 return false; |
| 13183 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); | 13197 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); |
| 13184 if (exceptionState.throwIfNeeded()) | 13198 if (exceptionState.throwIfNeeded()) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 13197 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13211 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13198 if (contextInPrivateScript.IsEmpty()) | 13212 if (contextInPrivateScript.IsEmpty()) |
| 13199 return false; | 13213 return false; |
| 13200 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13214 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13201 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13215 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13202 if (!scriptState->executionContext()) | 13216 if (!scriptState->executionContext()) |
| 13203 return false; | 13217 return false; |
| 13204 | 13218 |
| 13205 ScriptState::Scope scope(scriptState); | 13219 ScriptState::Scope scope(scriptState); |
| 13206 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13220 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13221 if (holder.IsEmpty()) |
| 13222 return false; |
| 13207 | 13223 |
| 13208 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA
ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate(
)); | 13224 ExceptionState exceptionState(ExceptionState::GetterContext, "readonlyShortA
ttribute", "TestObject", scriptState->context()->Global(), scriptState->isolate(
)); |
| 13209 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "readonlyShortAttribute", hold
er); | 13225 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "readonlyShortAttribute", hold
er); |
| 13210 if (v8Value.IsEmpty()) | 13226 if (v8Value.IsEmpty()) |
| 13211 return false; | 13227 return false; |
| 13212 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); | 13228 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); |
| 13213 if (exceptionState.throwIfNeeded()) | 13229 if (exceptionState.throwIfNeeded()) |
| 13214 return false; | 13230 return false; |
| 13215 RELEASE_ASSERT(!exceptionState.hadException()); | 13231 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13216 *result = cppValue; | 13232 *result = cppValue; |
| 13217 return true; | 13233 return true; |
| 13218 } | 13234 } |
| 13219 | 13235 |
| 13220 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
e, TestObject* holderImpl, int* result) | 13236 bool V8TestObject::PrivateScript::shortAttributeAttributeGetter(LocalFrame* fram
e, TestObject* holderImpl, int* result) |
| 13221 { | 13237 { |
| 13222 if (!frame) | 13238 if (!frame) |
| 13223 return false; | 13239 return false; |
| 13224 v8::HandleScope handleScope(toIsolate(frame)); | 13240 v8::HandleScope handleScope(toIsolate(frame)); |
| 13225 ScriptForbiddenScope::AllowUserAgentScript script; | 13241 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13226 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13242 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13227 if (contextInPrivateScript.IsEmpty()) | 13243 if (contextInPrivateScript.IsEmpty()) |
| 13228 return false; | 13244 return false; |
| 13229 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13245 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13230 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13246 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13231 if (!scriptState->executionContext()) | 13247 if (!scriptState->executionContext()) |
| 13232 return false; | 13248 return false; |
| 13233 | 13249 |
| 13234 ScriptState::Scope scope(scriptState); | 13250 ScriptState::Scope scope(scriptState); |
| 13235 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13251 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13252 if (holder.IsEmpty()) |
| 13253 return false; |
| 13236 | 13254 |
| 13237 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 13255 ExceptionState exceptionState(ExceptionState::GetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 13238 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder); | 13256 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "shortAttribute", holder); |
| 13239 if (v8Value.IsEmpty()) | 13257 if (v8Value.IsEmpty()) |
| 13240 return false; | 13258 return false; |
| 13241 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); | 13259 int cppValue = toInt16(scriptState->isolate(), v8Value, NormalConversion, ex
ceptionState); |
| 13242 if (exceptionState.throwIfNeeded()) | 13260 if (exceptionState.throwIfNeeded()) |
| 13243 return false; | 13261 return false; |
| 13244 RELEASE_ASSERT(!exceptionState.hadException()); | 13262 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13245 *result = cppValue; | 13263 *result = cppValue; |
| 13246 return true; | 13264 return true; |
| 13247 } | 13265 } |
| 13248 | 13266 |
| 13249 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram
e, TestObject* holderImpl, int cppValue) | 13267 bool V8TestObject::PrivateScript::shortAttributeAttributeSetter(LocalFrame* fram
e, TestObject* holderImpl, int cppValue) |
| 13250 { | 13268 { |
| 13251 if (!frame) | 13269 if (!frame) |
| 13252 return false; | 13270 return false; |
| 13253 v8::HandleScope handleScope(toIsolate(frame)); | 13271 v8::HandleScope handleScope(toIsolate(frame)); |
| 13254 ScriptForbiddenScope::AllowUserAgentScript script; | 13272 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13255 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13273 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13256 if (contextInPrivateScript.IsEmpty()) | 13274 if (contextInPrivateScript.IsEmpty()) |
| 13257 return false; | 13275 return false; |
| 13258 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13276 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13259 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13277 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13260 if (!scriptState->executionContext()) | 13278 if (!scriptState->executionContext()) |
| 13261 return false; | 13279 return false; |
| 13262 | 13280 |
| 13263 ScriptState::Scope scope(scriptState); | 13281 ScriptState::Scope scope(scriptState); |
| 13264 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13282 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13283 if (holder.IsEmpty()) |
| 13284 return false; |
| 13265 | 13285 |
| 13266 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 13286 ExceptionState exceptionState(ExceptionState::SetterContext, "shortAttribute
", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 13267 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "shortAttribute", holder, v8::Integer::New(scriptState
->isolate(), cppValue)); | 13287 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "shortAttribute", holder, v8::Integer::New(scriptState
->isolate(), cppValue)); |
| 13268 } | 13288 } |
| 13269 | 13289 |
| 13270 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
me, TestObject* holderImpl, String* result) | 13290 bool V8TestObject::PrivateScript::stringAttributeAttributeGetter(LocalFrame* fra
me, TestObject* holderImpl, String* result) |
| 13271 { | 13291 { |
| 13272 if (!frame) | 13292 if (!frame) |
| 13273 return false; | 13293 return false; |
| 13274 v8::HandleScope handleScope(toIsolate(frame)); | 13294 v8::HandleScope handleScope(toIsolate(frame)); |
| 13275 ScriptForbiddenScope::AllowUserAgentScript script; | 13295 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13276 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13296 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13277 if (contextInPrivateScript.IsEmpty()) | 13297 if (contextInPrivateScript.IsEmpty()) |
| 13278 return false; | 13298 return false; |
| 13279 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13299 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13280 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13300 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13281 if (!scriptState->executionContext()) | 13301 if (!scriptState->executionContext()) |
| 13282 return false; | 13302 return false; |
| 13283 | 13303 |
| 13284 ScriptState::Scope scope(scriptState); | 13304 ScriptState::Scope scope(scriptState); |
| 13285 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13305 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13306 if (holder.IsEmpty()) |
| 13307 return false; |
| 13286 | 13308 |
| 13287 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 13309 ExceptionState exceptionState(ExceptionState::GetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 13288 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder); | 13310 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "stringAttribute", holder); |
| 13289 if (v8Value.IsEmpty()) | 13311 if (v8Value.IsEmpty()) |
| 13290 return false; | 13312 return false; |
| 13291 V8StringResource<> cppValue = v8Value; | 13313 V8StringResource<> cppValue = v8Value; |
| 13292 if (!cppValue.prepare()) | 13314 if (!cppValue.prepare()) |
| 13293 return false; | 13315 return false; |
| 13294 RELEASE_ASSERT(!exceptionState.hadException()); | 13316 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13295 *result = cppValue; | 13317 *result = cppValue; |
| 13296 return true; | 13318 return true; |
| 13297 } | 13319 } |
| 13298 | 13320 |
| 13299 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra
me, TestObject* holderImpl, String cppValue) | 13321 bool V8TestObject::PrivateScript::stringAttributeAttributeSetter(LocalFrame* fra
me, TestObject* holderImpl, String cppValue) |
| 13300 { | 13322 { |
| 13301 if (!frame) | 13323 if (!frame) |
| 13302 return false; | 13324 return false; |
| 13303 v8::HandleScope handleScope(toIsolate(frame)); | 13325 v8::HandleScope handleScope(toIsolate(frame)); |
| 13304 ScriptForbiddenScope::AllowUserAgentScript script; | 13326 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13305 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13327 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13306 if (contextInPrivateScript.IsEmpty()) | 13328 if (contextInPrivateScript.IsEmpty()) |
| 13307 return false; | 13329 return false; |
| 13308 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13330 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13309 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13331 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13310 if (!scriptState->executionContext()) | 13332 if (!scriptState->executionContext()) |
| 13311 return false; | 13333 return false; |
| 13312 | 13334 |
| 13313 ScriptState::Scope scope(scriptState); | 13335 ScriptState::Scope scope(scriptState); |
| 13314 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13336 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13337 if (holder.IsEmpty()) |
| 13338 return false; |
| 13315 | 13339 |
| 13316 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 13340 ExceptionState exceptionState(ExceptionState::SetterContext, "stringAttribut
e", "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 13317 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "stringAttribute", holder, v8String(scriptState->isola
te(), cppValue)); | 13341 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "stringAttribute", holder, v8String(scriptState->isola
te(), cppValue)); |
| 13318 } | 13342 } |
| 13319 | 13343 |
| 13320 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame
, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) | 13344 bool V8TestObject::PrivateScript::nodeAttributeAttributeGetter(LocalFrame* frame
, TestObject* holderImpl, RefPtrWillBeRawPtr<Node>* result) |
| 13321 { | 13345 { |
| 13322 if (!frame) | 13346 if (!frame) |
| 13323 return false; | 13347 return false; |
| 13324 v8::HandleScope handleScope(toIsolate(frame)); | 13348 v8::HandleScope handleScope(toIsolate(frame)); |
| 13325 ScriptForbiddenScope::AllowUserAgentScript script; | 13349 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13326 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13350 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13327 if (contextInPrivateScript.IsEmpty()) | 13351 if (contextInPrivateScript.IsEmpty()) |
| 13328 return false; | 13352 return false; |
| 13329 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13353 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13330 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13354 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13331 if (!scriptState->executionContext()) | 13355 if (!scriptState->executionContext()) |
| 13332 return false; | 13356 return false; |
| 13333 | 13357 |
| 13334 ScriptState::Scope scope(scriptState); | 13358 ScriptState::Scope scope(scriptState); |
| 13335 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13359 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13360 if (holder.IsEmpty()) |
| 13361 return false; |
| 13336 | 13362 |
| 13337 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 13363 ExceptionState exceptionState(ExceptionState::GetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 13338 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder); | 13364 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "nodeAttribute", holder); |
| 13339 if (v8Value.IsEmpty()) | 13365 if (v8Value.IsEmpty()) |
| 13340 return false; | 13366 return false; |
| 13341 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); | 13367 Node* cppValue = V8Node::toImplWithTypeCheck(scriptState->isolate(), v8Value
); |
| 13342 RELEASE_ASSERT(!exceptionState.hadException()); | 13368 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13343 *result = cppValue; | 13369 *result = cppValue; |
| 13344 return true; | 13370 return true; |
| 13345 } | 13371 } |
| 13346 | 13372 |
| 13347 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame
, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) | 13373 bool V8TestObject::PrivateScript::nodeAttributeAttributeSetter(LocalFrame* frame
, TestObject* holderImpl, PassRefPtrWillBeRawPtr<Node> cppValue) |
| 13348 { | 13374 { |
| 13349 if (!frame) | 13375 if (!frame) |
| 13350 return false; | 13376 return false; |
| 13351 v8::HandleScope handleScope(toIsolate(frame)); | 13377 v8::HandleScope handleScope(toIsolate(frame)); |
| 13352 ScriptForbiddenScope::AllowUserAgentScript script; | 13378 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13353 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13379 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13354 if (contextInPrivateScript.IsEmpty()) | 13380 if (contextInPrivateScript.IsEmpty()) |
| 13355 return false; | 13381 return false; |
| 13356 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13382 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13357 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13383 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13358 if (!scriptState->executionContext()) | 13384 if (!scriptState->executionContext()) |
| 13359 return false; | 13385 return false; |
| 13360 | 13386 |
| 13361 ScriptState::Scope scope(scriptState); | 13387 ScriptState::Scope scope(scriptState); |
| 13362 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13388 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13389 if (holder.IsEmpty()) |
| 13390 return false; |
| 13363 | 13391 |
| 13364 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); | 13392 ExceptionState exceptionState(ExceptionState::SetterContext, "nodeAttribute"
, "TestObject", scriptState->context()->Global(), scriptState->isolate()); |
| 13365 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "nodeAttribute", holder, toV8(cppValue, scriptState->c
ontext()->Global(), scriptState->isolate())); | 13393 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "nodeAttribute", holder, toV8(cppValue, scriptState->c
ontext()->Global(), scriptState->isolate())); |
| 13366 } | 13394 } |
| 13367 | 13395 |
| 13368 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
ocalFrame* frame, TestObject* holderImpl, String* result) | 13396 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeGetter(L
ocalFrame* frame, TestObject* holderImpl, String* result) |
| 13369 { | 13397 { |
| 13370 if (!frame) | 13398 if (!frame) |
| 13371 return false; | 13399 return false; |
| 13372 v8::HandleScope handleScope(toIsolate(frame)); | 13400 v8::HandleScope handleScope(toIsolate(frame)); |
| 13373 ScriptForbiddenScope::AllowUserAgentScript script; | 13401 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13374 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13402 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13375 if (contextInPrivateScript.IsEmpty()) | 13403 if (contextInPrivateScript.IsEmpty()) |
| 13376 return false; | 13404 return false; |
| 13377 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13405 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13378 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13406 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13379 if (!scriptState->executionContext()) | 13407 if (!scriptState->executionContext()) |
| 13380 return false; | 13408 return false; |
| 13381 | 13409 |
| 13382 ScriptState::Scope scope(scriptState); | 13410 ScriptState::Scope scope(scriptState); |
| 13383 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13411 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13412 if (holder.IsEmpty()) |
| 13413 return false; |
| 13384 | 13414 |
| 13385 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 13415 ExceptionState exceptionState(ExceptionState::GetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
| 13386 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly
", holder); | 13416 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "attributeForPrivateScriptOnly
", holder); |
| 13387 if (v8Value.IsEmpty()) | 13417 if (v8Value.IsEmpty()) |
| 13388 return false; | 13418 return false; |
| 13389 V8StringResource<> cppValue = v8Value; | 13419 V8StringResource<> cppValue = v8Value; |
| 13390 if (!cppValue.prepare()) | 13420 if (!cppValue.prepare()) |
| 13391 return false; | 13421 return false; |
| 13392 RELEASE_ASSERT(!exceptionState.hadException()); | 13422 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13393 *result = cppValue; | 13423 *result = cppValue; |
| 13394 return true; | 13424 return true; |
| 13395 } | 13425 } |
| 13396 | 13426 |
| 13397 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L
ocalFrame* frame, TestObject* holderImpl, String cppValue) | 13427 bool V8TestObject::PrivateScript::attributeForPrivateScriptOnlyAttributeSetter(L
ocalFrame* frame, TestObject* holderImpl, String cppValue) |
| 13398 { | 13428 { |
| 13399 if (!frame) | 13429 if (!frame) |
| 13400 return false; | 13430 return false; |
| 13401 v8::HandleScope handleScope(toIsolate(frame)); | 13431 v8::HandleScope handleScope(toIsolate(frame)); |
| 13402 ScriptForbiddenScope::AllowUserAgentScript script; | 13432 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13403 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13433 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13404 if (contextInPrivateScript.IsEmpty()) | 13434 if (contextInPrivateScript.IsEmpty()) |
| 13405 return false; | 13435 return false; |
| 13406 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13436 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13407 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13437 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13408 if (!scriptState->executionContext()) | 13438 if (!scriptState->executionContext()) |
| 13409 return false; | 13439 return false; |
| 13410 | 13440 |
| 13411 ScriptState::Scope scope(scriptState); | 13441 ScriptState::Scope scope(scriptState); |
| 13412 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13442 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13443 if (holder.IsEmpty()) |
| 13444 return false; |
| 13413 | 13445 |
| 13414 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); | 13446 ExceptionState exceptionState(ExceptionState::SetterContext, "attributeForPr
ivateScriptOnly", "TestObject", scriptState->context()->Global(), scriptState->i
solate()); |
| 13415 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "attributeForPrivateScriptOnly", holder, v8String(scri
ptState->isolate(), cppValue)); | 13447 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "attributeForPrivateScriptOnly", holder, v8String(scri
ptState->isolate(), cppValue)); |
| 13416 } | 13448 } |
| 13417 | 13449 |
| 13418 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame
* frame, TestObject* holderImpl, String* result) | 13450 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeGetter(LocalFrame
* frame, TestObject* holderImpl, String* result) |
| 13419 { | 13451 { |
| 13420 if (!frame) | 13452 if (!frame) |
| 13421 return false; | 13453 return false; |
| 13422 v8::HandleScope handleScope(toIsolate(frame)); | 13454 v8::HandleScope handleScope(toIsolate(frame)); |
| 13423 ScriptForbiddenScope::AllowUserAgentScript script; | 13455 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13424 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13456 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13425 if (contextInPrivateScript.IsEmpty()) | 13457 if (contextInPrivateScript.IsEmpty()) |
| 13426 return false; | 13458 return false; |
| 13427 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13459 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13428 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13460 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13429 if (!scriptState->executionContext()) | 13461 if (!scriptState->executionContext()) |
| 13430 return false; | 13462 return false; |
| 13431 | 13463 |
| 13432 ScriptState::Scope scope(scriptState); | 13464 ScriptState::Scope scope(scriptState); |
| 13433 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13465 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13466 if (holder.IsEmpty()) |
| 13467 return false; |
| 13434 | 13468 |
| 13435 ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; | 13469 ExceptionState exceptionState(ExceptionState::GetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; |
| 13436 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder
); | 13470 v8::Local<v8::Value> v8Value = PrivateScriptRunner::runDOMAttributeGetter(sc
riptState, scriptStateInUserScript, "TestObject", "enumForPrivateScript", holder
); |
| 13437 if (v8Value.IsEmpty()) | 13471 if (v8Value.IsEmpty()) |
| 13438 return false; | 13472 return false; |
| 13439 V8StringResource<> cppValue = v8Value; | 13473 V8StringResource<> cppValue = v8Value; |
| 13440 if (!cppValue.prepare()) | 13474 if (!cppValue.prepare()) |
| 13441 return false; | 13475 return false; |
| 13442 RELEASE_ASSERT(!exceptionState.hadException()); | 13476 RELEASE_ASSERT(!exceptionState.hadException()); |
| 13443 *result = cppValue; | 13477 *result = cppValue; |
| 13444 return true; | 13478 return true; |
| 13445 } | 13479 } |
| 13446 | 13480 |
| 13447 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame
* frame, TestObject* holderImpl, String cppValue) | 13481 bool V8TestObject::PrivateScript::enumForPrivateScriptAttributeSetter(LocalFrame
* frame, TestObject* holderImpl, String cppValue) |
| 13448 { | 13482 { |
| 13449 if (!frame) | 13483 if (!frame) |
| 13450 return false; | 13484 return false; |
| 13451 v8::HandleScope handleScope(toIsolate(frame)); | 13485 v8::HandleScope handleScope(toIsolate(frame)); |
| 13452 ScriptForbiddenScope::AllowUserAgentScript script; | 13486 ScriptForbiddenScope::AllowUserAgentScript script; |
| 13453 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); | 13487 v8::Local<v8::Context> contextInPrivateScript = toV8Context(frame, DOMWrappe
rWorld::privateScriptIsolatedWorld()); |
| 13454 if (contextInPrivateScript.IsEmpty()) | 13488 if (contextInPrivateScript.IsEmpty()) |
| 13455 return false; | 13489 return false; |
| 13456 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); | 13490 ScriptState* scriptState = ScriptState::from(contextInPrivateScript); |
| 13457 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); | 13491 ScriptState* scriptStateInUserScript = ScriptState::forMainWorld(frame); |
| 13458 if (!scriptState->executionContext()) | 13492 if (!scriptState->executionContext()) |
| 13459 return false; | 13493 return false; |
| 13460 | 13494 |
| 13461 ScriptState::Scope scope(scriptState); | 13495 ScriptState::Scope scope(scriptState); |
| 13462 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); | 13496 v8::Local<v8::Value> holder = toV8(holderImpl, scriptState->context()->Globa
l(), scriptState->isolate()); |
| 13497 if (holder.IsEmpty()) |
| 13498 return false; |
| 13463 | 13499 |
| 13464 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; | 13500 ExceptionState exceptionState(ExceptionState::SetterContext, "enumForPrivate
Script", "TestObject", scriptState->context()->Global(), scriptState->isolate())
; |
| 13465 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->
isolate(), cppValue)); | 13501 return PrivateScriptRunner::runDOMAttributeSetter(scriptState, scriptStateIn
UserScript, "TestObject", "enumForPrivateScript", holder, v8String(scriptState->
isolate(), cppValue)); |
| 13466 } | 13502 } |
| 13467 | 13503 |
| 13468 } // namespace blink | 13504 } // namespace blink |
| OLD | NEW |