summaryrefslogtreecommitdiffstats
path: root/chrome/browser/renderer_host/render_widget_helper.h
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 15:57:39 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 15:57:39 +0000
commiteb6b87abf7962a109beb197cbabf46fb6baf1028 (patch)
tree25d7b2a3f613d89154bbc8b9d8134d9e3958177e /chrome/browser/renderer_host/render_widget_helper.h
parent4f48e5f82280a06f10134c34a2e4d217c3b8ce7c (diff)
downloadchromium_src-eb6b87abf7962a109beb197cbabf46fb6baf1028.zip
chromium_src-eb6b87abf7962a109beb197cbabf46fb6baf1028.tar.gz
chromium_src-eb6b87abf7962a109beb197cbabf46fb6baf1028.tar.bz2
Fix a race condition where rapid back/forward clicks could close a tab
This can be triggered when you're on the new tab page, going to *two* other sites, then rapidly hitting back and forward randomly. If a cross-site transition was canceled before the original page responds with an "OK to close me" message, it will mistakenly categorize the close as not just for the RenderView (correspondong to one side of the cross-site transition) but for the entire tab. This change adds an explicit parameter on the messages indicating whether it's for interstials or for the tab so we don't have to rely on the request still being active. This also adds the "requesting process + route" in addition to the "new process + request" so we can be more clear about sending the messages to the correct place. The previous patch conbimed these in a confusing way. BUG=16246 TEST=none Review URL: http://codereview.chromium.org/159255 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21531 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/render_widget_helper.h')
-rw-r--r--chrome/browser/renderer_host/render_widget_helper.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/chrome/browser/renderer_host/render_widget_helper.h b/chrome/browser/renderer_host/render_widget_helper.h
index 0ff672b..87c97be 100644
--- a/chrome/browser/renderer_host/render_widget_helper.h
+++ b/chrome/browser/renderer_host/render_widget_helper.h
@@ -26,6 +26,7 @@ class TimeDelta;
class MessageLoop;
class ResourceDispatcherHost;
+struct ViewMsg_ClosePage_Params;
// Instantiated per RenderProcessHost to provide various optimizations on
// behalf of a RenderWidgetHost. This class bridges between the IO thread
@@ -104,8 +105,7 @@ class RenderWidgetHelper :
// corresponding functions in RenderProcessHost. See those declarations
// for documentation.
void CancelResourceRequests(int render_widget_id);
- void CrossSiteClosePageACK(int new_render_process_host_id,
- int new_request_id);
+ void CrossSiteClosePageACK(const ViewMsg_ClosePage_Params& params);
bool WaitForPaintMsg(int render_widget_id,
const base::TimeDelta& max_delay,
IPC::Message* msg);
@@ -174,8 +174,7 @@ class RenderWidgetHelper :
void OnCancelResourceRequests(int render_widget_id);
// Called on the IO thread to resume a cross-site response.
- void OnCrossSiteClosePageACK(int new_render_process_host_id,
- int new_request_id);
+ void OnCrossSiteClosePageACK(ViewMsg_ClosePage_Params params);
#if defined(OS_MACOSX)
// Called on destruction to release all allocated transport DIBs