| Index: Source/web/WebLocalFrameImpl.cpp
|
| diff --git a/Source/web/WebLocalFrameImpl.cpp b/Source/web/WebLocalFrameImpl.cpp
|
| index f5083e2121b94c85a313476359de0e3e669ebaec..f51d641f4d6d534bcc7e607b8899dfa37d5d33d9 100644
|
| --- a/Source/web/WebLocalFrameImpl.cpp
|
| +++ b/Source/web/WebLocalFrameImpl.cpp
|
| @@ -725,7 +725,6 @@
|
| {
|
| ASSERT(frame());
|
| TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first());
|
| - v8::HandleScope handleScope(toIsolate(frame()));
|
| frame()->script().executeScriptInMainWorld(ScriptSourceCode(source.code, source.url, position));
|
| }
|
|
|
| @@ -808,7 +807,7 @@
|
| UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
|
|
|
| TextPosition position(OrdinalNumber::fromOneBasedInt(source.startLine), OrdinalNumber::first());
|
| - return frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(source.code, source.url, position));
|
| + return frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(source.code, source.url, position)).v8Value();
|
| }
|
|
|
| void WebLocalFrameImpl::executeScriptInIsolatedWorld(int worldID, const WebScriptSource* sourcesIn, unsigned numSources, int extensionGroup, WebVector<v8::Local<v8::Value> >* results)
|
| @@ -825,11 +824,11 @@
|
| }
|
|
|
| if (results) {
|
| - Vector<v8::Local<v8::Value> > scriptResults;
|
| + Vector<ScriptValue> scriptResults;
|
| frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensionGroup, &scriptResults);
|
| WebVector<v8::Local<v8::Value> > v8Results(scriptResults.size());
|
| for (unsigned i = 0; i < scriptResults.size(); i++)
|
| - v8Results[i] = v8::Local<v8::Value>::New(toIsolate(frame()), scriptResults[i]);
|
| + v8Results[i] = v8::Local<v8::Value>::New(toIsolate(frame()), scriptResults[i].v8Value());
|
| results->swap(v8Results);
|
| } else {
|
| frame()->script().executeScriptInIsolatedWorld(worldID, sources, extensionGroup, 0);
|
| @@ -1861,11 +1860,12 @@
|
|
|
| String script = decodeURLEscapeSequences(url.string().substring(strlen("javascript:")));
|
| UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
|
| - v8::HandleScope handleScope(toIsolate(frame()));
|
| - v8::Local<v8::Value> result = frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script));
|
| - if (result.IsEmpty() || !result->IsString())
|
| - return;
|
| - String scriptResult = toCoreString(v8::Handle<v8::String>::Cast(result));
|
| + ScriptValue result = frame()->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script));
|
| +
|
| + String scriptResult;
|
| + if (!result.toString(scriptResult))
|
| + return;
|
| +
|
| if (!frame()->navigationScheduler().locationChangePending())
|
| frame()->document()->loader()->replaceDocument(scriptResult, ownerDocument.get());
|
| }
|
|
|