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

Unified Diff: content/browser/tab_contents/tab_contents.cc

Issue 9271054: Send replies to sync IPCs from swapped out renderers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 11 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/tab_contents/tab_contents.h ('k') | content/common/swapped_out_messages.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tab_contents/tab_contents.cc
diff --git a/content/browser/tab_contents/tab_contents.cc b/content/browser/tab_contents/tab_contents.cc
index 013f8d56eca31777e282c120ae83f4b9465560df..d162d372b850c3b6b856cb3ec9226de18782b282 100644
--- a/content/browser/tab_contents/tab_contents.cc
+++ b/content/browser/tab_contents/tab_contents.cc
@@ -2006,7 +2006,7 @@ void TabContents::RequestTransferURL(const GURL& url,
}
void TabContents::RunJavaScriptMessage(
- const RenderViewHost* rvh,
+ RenderViewHost* rvh,
const string16& message,
const string16& default_prompt,
const GURL& frame_url,
@@ -2050,13 +2050,13 @@ void TabContents::RunJavaScriptMessage(
if (suppress_this_message) {
// If we are suppressing messages, just reply as if the user immediately
// pressed "Cancel".
- OnDialogClosed(reply_msg, false, string16());
+ OnDialogClosed(rvh, reply_msg, false, string16());
}
*did_suppress_message = suppress_this_message;
}
-void TabContents::RunBeforeUnloadConfirm(const RenderViewHost* rvh,
+void TabContents::RunBeforeUnloadConfirm(RenderViewHost* rvh,
const string16& message,
IPC::Message* reply_msg) {
if (delegate_)
@@ -2067,7 +2067,7 @@ void TabContents::RunBeforeUnloadConfirm(const RenderViewHost* rvh,
!delegate_ ||
delegate_->ShouldSuppressDialogs();
if (suppress_this_message) {
- GetRenderViewHost()->JavaScriptDialogClosed(reply_msg, true, string16());
+ rvh->JavaScriptDialogClosed(reply_msg, true, string16());
return;
}
@@ -2253,7 +2253,8 @@ bool TabContents::CreateRenderViewForRenderManager(
return true;
}
-void TabContents::OnDialogClosed(IPC::Message* reply_msg,
+void TabContents::OnDialogClosed(RenderViewHost* rvh,
+ IPC::Message* reply_msg,
bool success,
const string16& user_input) {
if (is_showing_before_unload_dialog_ && !success) {
@@ -2264,7 +2265,11 @@ void TabContents::OnDialogClosed(IPC::Message* reply_msg,
tab_close_start_time_ = base::TimeTicks();
}
is_showing_before_unload_dialog_ = false;
- GetRenderViewHost()->JavaScriptDialogClosed(reply_msg, success, user_input);
+ // TODO(creis): We shouldn't have this. The API should make it possible
+ // to send the reply to the right RVH implicitly.
jam 2012/01/26 00:29:21 I don't understand which API you mean? and how thi
+ if (!rvh)
+ rvh = GetRenderViewHost();
+ rvh->JavaScriptDialogClosed(reply_msg, success, user_input);
Charlie Reis 2012/01/26 00:17:52 I recognize that we probably don't want to add Ren
}
gfx::NativeWindow TabContents::GetDialogRootWindow() const {
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/common/swapped_out_messages.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698