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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2858743003: Don’t call functions on a possibly-deleted object (Closed)
Patch Set: comment Created 3 years, 8 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 | « content/browser/frame_host/render_frame_host_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 18572e8f4826a6f64bdc6c2af133abee283e5ab9..207e1884377f31b2d13ae93c14a22d5e5a3c5a1a 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -4363,9 +4363,6 @@ void WebContentsImpl::RunJavaScriptDialog(RenderFrameHost* render_frame_host,
render_frame_host->GetRoutingID(), reply_msg,
true, false, base::string16());
}
-
- // OnDialogClosed (two lines up) may have caused deletion of this object (see
- // http://crbug.com/288961 ). The only safe thing to do here is return.
Charlie Reis 2017/05/03 21:33:46 Good find that this used to happen in RenderFrameH
Avi (use Gerrit) 2017/05/04 15:15:04 2017 me is super grateful to 2013 me for the hint.
}
void WebContentsImpl::RunBeforeUnloadConfirm(
@@ -4383,7 +4380,7 @@ void WebContentsImpl::RunBeforeUnloadConfirm(
delegate_->ShouldSuppressDialogs(this) ||
!delegate_->GetJavaScriptDialogManager(this);
if (suppress_this_message) {
- rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16(), true);
+ rfhi->JavaScriptDialogClosed(reply_msg, true, base::string16());
return;
}
@@ -5269,8 +5266,7 @@ void WebContentsImpl::OnDialogClosed(int render_process_id,
}
if (rfh) {
- rfh->JavaScriptDialogClosed(reply_msg, success, user_input,
- dialog_was_suppressed);
+ rfh->JavaScriptDialogClosed(reply_msg, success, user_input);
} else {
// Don't leak the sync IPC reply if the RFH or process is gone.
delete reply_msg;
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698