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

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

Issue 257863004: Revert of Ensure that modal dialogs from subframes can be cleaned up correctly. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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/web_contents/web_contents_impl.h ('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 41586157ccb288e04f96d71df0922ed569ef0c8d..2d05483deb87363c0809222b13b89c48845d2c72 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3068,8 +3068,7 @@
default_prompt,
base::Bind(&WebContentsImpl::OnDialogClosed,
base::Unretained(this),
- rfh->GetProcess()->GetID(),
- rfh->GetRoutingID(),
+ rfh,
reply_msg,
false),
&suppress_this_message);
@@ -3078,8 +3077,7 @@
if (suppress_this_message) {
// If we are suppressing messages, just reply as if the user immediately
// pressed "Cancel", passing true to |dialog_was_suppressed|.
- OnDialogClosed(rfh->GetProcess()->GetID(), rfh->GetRoutingID(), reply_msg,
- true, false, base::string16());
+ OnDialogClosed(rfh, reply_msg, true, false, base::string16());
}
// OnDialogClosed (two lines up) may have caused deletion of this object (see
@@ -3112,8 +3110,7 @@
dialog_manager_->RunBeforeUnloadDialog(
this, message, is_reload,
base::Bind(&WebContentsImpl::OnDialogClosed, base::Unretained(this),
- rfh->GetProcess()->GetID(), rfh->GetRoutingID(), reply_msg,
- false));
+ rfh, reply_msg, false));
}
WebContents* WebContentsImpl::GetAsWebContents() {
@@ -3787,21 +3784,17 @@
}
#endif
-void WebContentsImpl::OnDialogClosed(int render_process_id,
- int render_frame_id,
+void WebContentsImpl::OnDialogClosed(RenderFrameHost* rfh,
IPC::Message* reply_msg,
bool dialog_was_suppressed,
bool success,
const base::string16& user_input) {
- RenderFrameHostImpl* rfh = RenderFrameHostImpl::FromID(render_process_id,
- render_frame_id);
last_dialog_suppressed_ = dialog_was_suppressed;
if (is_showing_before_unload_dialog_ && !success) {
// If a beforeunload dialog is canceled, we need to stop the throbber from
// spinning, since we forced it to start spinning in Navigate.
- if (rfh)
- DidStopLoading(rfh);
+ DidStopLoading(rfh);
controller_.DiscardNonCommittedEntries();
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
@@ -3809,10 +3802,8 @@
}
is_showing_before_unload_dialog_ = false;
- if (rfh) {
- rfh->JavaScriptDialogClosed(reply_msg, success, user_input,
- dialog_was_suppressed);
- }
+ static_cast<RenderFrameHostImpl*>(rfh)->JavaScriptDialogClosed(
+ reply_msg, success, user_input, dialog_was_suppressed);
}
void WebContentsImpl::SetEncoding(const std::string& encoding) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698