Commit 6202ea84 authored by haraken@chromium.org's avatar haraken@chromium.org

Remove a EscapableHandleScope from executeScriptInIsolatedWorld()

It is wrong to call EscapableHandleScope::Escape() multiple times
in executeScriptInIsolatedWorld(). Since the callers of executeScriptInIsolatedWorld()
already have HandleScopes, we can just simply remove a EscapableHandleScope
from executeScriptInIsolatedWorld().

Review URL: https://codereview.chromium.org/713743002

git-svn-id: svn://svn.chromium.org/blink/trunk@185106 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 17244e9a
...@@ -637,8 +637,7 @@ void ScriptController::executeScriptInIsolatedWorld(int worldID, const Vector<Sc ...@@ -637,8 +637,7 @@ void ScriptController::executeScriptInIsolatedWorld(int worldID, const Vector<Sc
return; return;
ScriptState* scriptState = isolatedWorldWindowProxy->scriptState(); ScriptState* scriptState = isolatedWorldWindowProxy->scriptState();
v8::EscapableHandleScope handleScope(scriptState->isolate()); v8::Context::Scope scope(scriptState->context());
ScriptState::Scope scope(scriptState);
v8::Local<v8::Array> resultArray = v8::Array::New(m_isolate, sources.size()); v8::Local<v8::Array> resultArray = v8::Array::New(m_isolate, sources.size());
for (size_t i = 0; i < sources.size(); ++i) { for (size_t i = 0; i < sources.size(); ++i) {
...@@ -650,7 +649,7 @@ void ScriptController::executeScriptInIsolatedWorld(int worldID, const Vector<Sc ...@@ -650,7 +649,7 @@ void ScriptController::executeScriptInIsolatedWorld(int worldID, const Vector<Sc
if (results) { if (results) {
for (size_t i = 0; i < resultArray->Length(); ++i) for (size_t i = 0; i < resultArray->Length(); ++i)
results->append(handleScope.Escape(resultArray->Get(i))); results->append(resultArray->Get(i));
} }
} }
......
...@@ -96,6 +96,7 @@ public: ...@@ -96,6 +96,7 @@ public:
// Otherwise, a new world is created. // Otherwise, a new world is created.
// //
// FIXME: Get rid of extensionGroup here. // FIXME: Get rid of extensionGroup here.
// FIXME: We don't want to support multiple scripts.
void executeScriptInIsolatedWorld(int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, Vector<v8::Local<v8::Value> >* results); void executeScriptInIsolatedWorld(int worldID, const Vector<ScriptSourceCode>& sources, int extensionGroup, Vector<v8::Local<v8::Value> >* results);
// Returns true if argument is a JavaScript URL. // Returns true if argument is a JavaScript URL.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment