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

Unified Diff: content/browser/frame_host/render_frame_host_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
Index: content/browser/frame_host/render_frame_host_impl.cc
diff --git a/content/browser/frame_host/render_frame_host_impl.cc b/content/browser/frame_host/render_frame_host_impl.cc
index b6282abb783303809d986e8b4df9d4bff13f412c..b61660d8ba8717cdf9f09ca77fe2231965e9ca26 100644
--- a/content/browser/frame_host/render_frame_host_impl.cc
+++ b/content/browser/frame_host/render_frame_host_impl.cc
@@ -2943,8 +2943,7 @@ void RenderFrameHostImpl::DeleteSurroundingTextInCodePoints(int before,
void RenderFrameHostImpl::JavaScriptDialogClosed(
IPC::Message* reply_msg,
bool success,
- const base::string16& user_input,
- bool dialog_was_suppressed) {
+ const base::string16& user_input) {
GetProcess()->SetIgnoreInputEvents(false);
SendJavaScriptDialogReply(reply_msg, success, user_input);
@@ -2953,17 +2952,10 @@ void RenderFrameHostImpl::JavaScriptDialogClosed(
// timers stopped in this frame or a frame up in the frame hierarchy. Restart
// any timers that were stopped in OnRunBeforeUnloadConfirm().
for (RenderFrameHostImpl* frame = this; frame; frame = frame->GetParent()) {
- if (frame->is_waiting_for_beforeunload_ack_) {
- // If we are waiting for a beforeunload ack and the user has suppressed
- // messages, kill the tab immediately. A page that's spamming is
- // presumably malicious, so there's no point in continuing to run its
- // script and dragging out the process.
- if (dialog_was_suppressed) {
- frame->SimulateBeforeUnloadAck();
- } else if (frame->beforeunload_timeout_) {
- frame->beforeunload_timeout_->Start(
- TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS));
- }
+ if (frame->is_waiting_for_beforeunload_ack_ &&
+ frame->beforeunload_timeout_) {
+ frame->beforeunload_timeout_->Start(
+ TimeDelta::FromMilliseconds(RenderViewHostImpl::kUnloadTimeoutMS));
}
}
}

Powered by Google App Engine
This is Rietveld 408576698