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

Unified Diff: chrome/browser/ui/views/frame/browser_view.cc

Issue 154633003: Attempt at fixing possible shutdown crash (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: OnWindowDestroying Created 6 years, 10 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
Index: chrome/browser/ui/views/frame/browser_view.cc
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index 655d51afe04d35b635796f00fee401553c66b677..3c06cc00e2581e837f50f89f85a7c1e2f1548264 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -437,6 +437,10 @@ BrowserView::BrowserView()
}
BrowserView::~BrowserView() {
+ // All the tabs should have been destroyed already. If we were closed by the
+ // OS with some tabs than the NativeBrowserFrame should have destroyed them.
+ DCHECK_EQ(0, browser_->tab_strip_model()->count());
+
// Immersive mode may need to reparent views before they are removed/deleted.
immersive_mode_controller_.reset();
@@ -477,16 +481,6 @@ BrowserView::~BrowserView() {
RemoveAllChildViews(true);
toolbar_ = NULL;
- // It is possible that we were forced-closed by the native view system and
- // that tabs remain in the browser. Close any such remaining tabs. Detach
- // before destroying in hopes of avoiding less callbacks trying to access
- // members since destroyed.
- {
- ScopedVector<content::WebContents> contents;
- while (browser_->tab_strip_model()->count())
- contents.push_back(browser_->tab_strip_model()->DetachWebContentsAt(0));
- }
-
// Explicitly set browser_ to NULL.
browser_.reset();
}
« no previous file with comments | « chrome/browser/ui/views/frame/browser_shutdown.cc ('k') | chrome/browser/ui/views/frame/browser_view_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698