Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2690)

Unified Diff: Source/web/WebLocalFrameImpl.cpp

Issue 326853002: Revert of Add an ASSERT about cross-world wrapper leakage into ScriptValue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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());
}
« no previous file with comments | « Source/modules/serviceworkers/WaitUntilObserver.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698