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

Unified Diff: Source/web/WebPluginContainerImpl.cpp

Issue 314953005: 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
Index: Source/web/WebPluginContainerImpl.cpp
diff --git a/Source/web/WebPluginContainerImpl.cpp b/Source/web/WebPluginContainerImpl.cpp
index e3881dca90fa35233aa035f62cf71710b12d1d3d..27e70b3fcf48d838c7cf736819624d03f8fd0650 100644
--- a/Source/web/WebPluginContainerImpl.cpp
+++ b/Source/web/WebPluginContainerImpl.cpp
@@ -442,12 +442,13 @@ WebString WebPluginContainerImpl::executeScriptURL(const WebURL& url, bool popup
kurl.string().substring(strlen("javascript:")));
UserGestureIndicator gestureIndicator(popupsAllowed ? DefinitelyProcessingNewUserGesture : PossiblyProcessingUserGesture);
- ScriptValue result = frame->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script));
+ v8::HandleScope handleScope(toIsolate(frame));
+ v8::Local<v8::Value> result = frame->script().executeScriptInMainWorldAndReturnValue(ScriptSourceCode(script));
// Failure is reported as a null string.
- String resultString;
- result.toString(resultString);
- return resultString;
+ if (result.IsEmpty() || !result->IsString())
+ return WebString();
+ return toCoreString(v8::Handle<v8::String>::Cast(result));
}
void WebPluginContainerImpl::loadFrameRequest(const WebURLRequest& request, const WebString& target, bool notifyNeeded, void* notifyData)
« Source/bindings/v8/ScriptController.cpp ('K') | « Source/web/WebLocalFrameImpl.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698