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

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 239393009: Don't crash when closing interstitial pages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: crash fix Created 6 years, 8 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/frame_host/interstitial_page_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 8aea87eae6df3c70b7b21a7f1ec03a1e53a1b19d..5d4e9003a776fa156fee91a96061c3d3368407a3 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -363,6 +363,14 @@ WebContentsImpl::WebContentsImpl(
WebContentsImpl::~WebContentsImpl() {
is_being_destroyed_ = true;
+ // If there is an interstitial page being shown, tell it to close down early
+ // so that this contents will be alive enough to handle all the UI triggered
+ // by that. <http://crbug.com/363564>
+ InterstitialPageImpl* interstitial_page =
+ static_cast<InterstitialPageImpl*>(GetInterstitialPage());
+ if (interstitial_page)
+ interstitial_page->WebContentsWillBeDestroyed();
+
// Delete all RFH pending shutdown, which will lead the corresponding RVH to
// shutdown and be deleted as well.
frame_tree_.ForEach(
@@ -1769,7 +1777,7 @@ void WebContentsImpl::AttachInterstitialPage(
}
void WebContentsImpl::DetachInterstitialPage() {
- if (GetInterstitialPage())
+ if (ShowingInterstitialPage())
GetRenderManager()->remove_interstitial_page();
FOR_EACH_OBSERVER(WebContentsObserver, observers_,
DidDetachInterstitialPage());
« no previous file with comments | « content/browser/frame_host/interstitial_page_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698