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

Unified Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 11099048: Merge 160443 - [Mac] During shutdown, do not post NSApplicationWillTerminateNotification twice. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1271/src/
Patch Set: Created 8 years, 2 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 | « no previous file | chrome/browser/lifetime/application_lifetime_mac.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_application_mac.mm
===================================================================
--- chrome/browser/chrome_browser_application_mac.mm (revision 161174)
+++ chrome/browser/chrome_browser_application_mac.mm (working copy)
@@ -331,14 +331,15 @@
// Termination is cancelled by resetting this flag. The standard
// |-applicationShouldTerminate:| is not supported, and code paths leading to it
// must be redirected.
+//
+// When the last browser has been destroyed, the BrowserList calls
+// browser::OnAppExiting(), which is the point of no return. That will cause
+// the NSApplicationWillTerminateNotification to be posted, which ends the
+// NSApplication event loop, so final post- MessageLoop::Run() work is done
+// before exiting.
- (void)terminate:(id)sender {
AppController* appController = static_cast<AppController*>([NSApp delegate]);
- if ([appController tryToTerminateApplication:self]) {
- [[NSNotificationCenter defaultCenter]
- postNotificationName:NSApplicationWillTerminateNotification
- object:self];
- }
-
+ [appController tryToTerminateApplication:self];
// Return, don't exit. The application is responsible for exiting on its own.
}
« no previous file with comments | « no previous file | chrome/browser/lifetime/application_lifetime_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698