diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 00:51:37 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-11-05 00:51:37 +0000 |
commit | 38733063b7e1cf0b6e67c0b590773ff4f1aaa18d (patch) | |
tree | 5d9a55ce719e75a928f1ac52a3fc07e76c1c9c21 | |
parent | 771e47c22478e28a0783a62cacba00d48402d7b8 (diff) | |
download | chromium_src-38733063b7e1cf0b6e67c0b590773ff4f1aaa18d.zip chromium_src-38733063b7e1cf0b6e67c0b590773ff4f1aaa18d.tar.gz chromium_src-38733063b7e1cf0b6e67c0b590773ff4f1aaa18d.tar.bz2 |
Evil hack to prevent a crash with interstitials across different tab contents types.
BUG=2855
Review URL: http://codereview.chromium.org/9141
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@4717 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/web_contents.cc | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index fe35c73..9a10c30 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -937,6 +937,29 @@ void WebContents::DidFailProvisionalLoadWithError( return; if (net::ERR_ABORTED == error_code) { + // EVIL HACK ALERT! Ignore failed loads when we're showing interstitials. + // This means that the interstitial won't be torn down properly, which is + // bad. But if we have an interstitial, go back to another tab type, and + // then load the same interstitial again, we could end up getting the first + // interstitial's "failed" message (as a result of the cancel) when we're on + // the second one. + // + // We can't tell this apart, so we think we're tearing down the current page + // which will cause a crash later one. There is also some code in + // RenderViewHostManager::RendererAbortedProvisionalLoad that is commented + // out because of this problem. + // + // http://code.google.com/p/chromium/issues/detail?id=2855 + // Because this will not tear down the interstitial properly, if "back" is + // back to another tab type, the interstitial will still be somewhat alive + // in the previous tab type. If you navigate somewhere that activates the + // tab with the interstitial again, you'll see a flash before the new load + // commits of the interstitial page. + if (render_manager_.showing_interstitial_page()) { + LOG(WARNING) << "Discarding message during interstitial."; + return; + } + // This will discard our pending entry if we cancelled the load (e.g., if we // decided to download the file instead of load it). Only discard the // pending entry if the URLs match, otherwise the user initiated a navigate |