Index: chrome/browser/ui/browser.cc |
diff --git a/chrome/browser/ui/browser.cc b/chrome/browser/ui/browser.cc |
index 832153b86e17201770479a2f4bfa17284c823b52..8682c00804f3af0a46307afe2410fd212ecc8eb6 100644 |
--- a/chrome/browser/ui/browser.cc |
+++ b/chrome/browser/ui/browser.cc |
@@ -746,6 +746,8 @@ void Browser::OnWindowClosing() { |
if (tab_restore_service && is_type_tabbed() && tab_strip_model_->count()) |
tab_restore_service->BrowserClosing(live_tab_context()); |
+ BrowserList::NotifyBrowserCloseStarted(this); |
+ |
// TODO(sky): convert session/tab restore to use notification. |
content::NotificationService::current()->Notify( |
chrome::NOTIFICATION_BROWSER_CLOSING, |
hashimoto
2017/04/14 08:54:37
How about moving this notification code to Browser
Alexey Seren
2017/04/22 19:52:54
Acknowledged.
|
@@ -2556,7 +2558,11 @@ bool Browser::ShouldHideUIForFullscreen() const { |
} |
bool Browser::ShouldStartShutdown() const { |
- return BrowserList::GetInstance()->size() <= 1; |
+ DCHECK_GE(BrowserList::GetInstance()->size(), |
+ BrowserList::GetInstance()->currently_closing_browsers_count()); |
+ // Start shutdown process only when closing the last browser. |
+ return BrowserList::GetInstance()->size() == |
+ BrowserList::GetInstance()->currently_closing_browsers_count() + 1; |
hashimoto
2017/04/14 08:54:37
Sorry, I still don't understand why this change is
Alexey Seren
2017/04/22 19:52:54
This fixes the races happened when two browsers ar
hashimoto
2017/04/28 09:16:29
Thank you for the explanation.
I don't think it's
Alexey Seren
2017/05/03 17:19:44
Actually we cannot cancel shutdown after we have e
|
} |
bool Browser::MaybeCreateBackgroundContents( |