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

Unified Diff: Source/WebKit/mac/WebView/WebFrame.mm

Issue 7734002: Merge 93732 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/835/
Patch Set: Created 9 years, 4 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/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/mac/WebView/WebFrame.mm
===================================================================
--- Source/WebKit/mac/WebView/WebFrame.mm (revision 93738)
+++ Source/WebKit/mac/WebView/WebFrame.mm (working copy)
@@ -608,6 +608,7 @@
- (NSString *)_stringByEvaluatingJavaScriptFromString:(NSString *)string forceUserGesture:(BOOL)forceUserGesture
{
ASSERT(_private->coreFrame->document());
+ RetainPtr<WebFrame> protect(self); // Executing arbitrary JavaScript can destroy the frame.
JSValue result = _private->coreFrame->script()->executeScript(string, forceUserGesture).jsValue();
@@ -1204,9 +1205,11 @@
// Get the frame frome the global object we've settled on.
Frame* frame = anyWorldGlobalObject->impl()->frame();
ASSERT(frame->document());
+ RetainPtr<WebFrame> webFrame(kit(frame)); // Running arbitrary JavaScript can destroy the frame.
+
JSValue result = frame->script()->executeScriptInWorld(core(world), string, true).jsValue();
- if (!frame) // In case the script removed our frame from the page.
+ if (!webFrame->_private->coreFrame) // In case the script removed our frame from the page.
return @"";
// This bizarre set of rules matches behavior from WebKit for Safari 2.0.
« no previous file with comments | « Source/WebKit/mac/Plugins/Hosted/NetscapePluginInstanceProxy.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698