From 38733063b7e1cf0b6e67c0b590773ff4f1aaa18d Mon Sep 17 00:00:00 2001 From: "brettw@google.com" Date: Wed, 5 Nov 2008 00:51:37 +0000 Subject: 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 --- chrome/browser/web_contents.cc | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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 -- cgit v1.1