diff options
author | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 01:18:56 +0000 |
---|---|---|
committer | ojan@google.com <ojan@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-06 01:18:56 +0000 |
commit | d878bab389753cb876231717217a7e470b5a261f (patch) | |
tree | 1f806e2126df04174e396755994ad9f2eec87c7c /chrome/browser/render_view_host.h | |
parent | dcc8f1c678af98247adc7a056ace7e6c145ed189 (diff) | |
download | chromium_src-d878bab389753cb876231717217a7e470b5a261f.zip chromium_src-d878bab389753cb876231717217a7e470b5a261f.tar.gz chromium_src-d878bab389753cb876231717217a7e470b5a261f.tar.bz2 |
Bandaid patch so that we continue with crosssite navigations instead of closing the tab if the beforeunload /unload handler hangs. This patch does the right user-visible behavior, but I'm not a huge fan of the plumbing necessary to make it work. Totally open to cleanup suggestions.
There's also currently one bug that I haven't been able to pinpoint in the UI test. It only treats the first UI test of the four that I run as a cross-site navigation. No matter which test I run first. I wonder if there is some state I should be setting/clearing before/after each test run?
Also there's a DHECK that we hit that the UI test exposed. I 'm not sure it's a case that a user could actually hit though and it's not new with this code, so I added a TODO.
Can I get help from a mac person on adding the UI test to the xcode project?
BUG=3198
Review URL: http://codereview.chromium.org/8920
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4855 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/render_view_host.h')
-rw-r--r-- | chrome/browser/render_view_host.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h index 7f7d298..d35c0b3 100644 --- a/chrome/browser/render_view_host.h +++ b/chrome/browser/render_view_host.h @@ -155,7 +155,12 @@ class RenderViewHost : public RenderWidgetHost { // for which another renderer will need to run an onunload event handler. // This is called before the first navigation event for this RenderViewHost, // and again after the corresponding OnCrossSiteResponse. - void SetHasPendingCrossSiteRequest(bool has_pending_request); + void SetHasPendingCrossSiteRequest(bool has_pending_request, int request_id); + + // Returns the request_id for the pending cross-site request. + // This is just needed in case the unload of the current page + // hangs, in which case we need to swap to the pending RenderViewHost. + int GetPendingRequestId(); // Called by ResourceDispatcherHost when a response for a pending cross-site // request is received. The ResourceDispatcherHost will pause the response @@ -540,6 +545,13 @@ class RenderViewHost : public RenderWidgetHost { // sending messages back to the browser. bool enable_dom_ui_bindings_; + // The request_id for the pending cross-site request. Set to -1 if + // there is a pending request, but we have not yet started the unload + // for the current page. Set to the request_id value of the pending + // request once we have gotten the some data for the pending page + // and thus started the unload process. + int pending_request_id_; + // True if javascript access to the external host (through // automation) is allowed. bool enable_external_host_bindings_; |