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) { |