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

Unified Diff: chrome/browser/chrome_browser_application_mac.mm

Issue 11066035: [Mac] During shutdown, do not post NSApplicationWillTerminateNotification twice. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: kill_me_now 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
diff --git a/chrome/browser/chrome_browser_application_mac.mm b/chrome/browser/chrome_browser_application_mac.mm
index 0e151e0bb7dd461b8efa90f95fa91b1981ae7d87..93ea7b0d87902bcda35948c84f836e4219e22b65 100644
--- a/chrome/browser/chrome_browser_application_mac.mm
+++ b/chrome/browser/chrome_browser_application_mac.mm
@@ -331,14 +331,15 @@ void SwizzleInit() {
// 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