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

Unified Diff: chrome/browser/lifetime/application_lifetime_mac.mm

Issue 11120002: [Mac] Do not post NSApplicationWillTerminateNotification via a task, do it immediately. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Need logging.h 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/lifetime/application_lifetime_mac.mm
diff --git a/chrome/browser/lifetime/application_lifetime_mac.mm b/chrome/browser/lifetime/application_lifetime_mac.mm
index 0e6b0ce00eac414d46d982af1fa029ed0f05b91f..e067f32666c0294555e1d86b7aef2410f358eb5c 100644
--- a/chrome/browser/lifetime/application_lifetime_mac.mm
+++ b/chrome/browser/lifetime/application_lifetime_mac.mm
@@ -8,37 +8,24 @@
#include "chrome/browser/lifetime/application_lifetime.h"
-#include "base/bind.h"
-#include "base/message_loop.h"
+#include "base/logging.h"
#include "chrome/browser/browser_shutdown.h"
#import "chrome/browser/chrome_browser_application_mac.h"
namespace browser {
-namespace {
-
-// A closure that is used to finalize application shutdown.
-void PerformTerminate() {
- [[NSNotificationCenter defaultCenter]
- postNotificationName:NSApplicationWillTerminateNotification
- object:NSApp];
-}
-
-} // namespace
-
// At this point, the user is trying to quit (or the system is forcing the
// application to quit) and all browsers have been successfully closed. The
// final step in shutdown is to post the NSApplicationWillTerminateNotification
-// to end the -[NSApplication run] event loop. That is performed via the
-// MessageLoop, since this can be called via the destruction path of the last
-// Browser object.
+// to end the -[NSApplication run] event loop.
void HandleAppExitingForPlatform() {
static bool kill_me_now = false;
CHECK(!kill_me_now);
kill_me_now = true;
- MessageLoop::current()->PostNonNestableTask(FROM_HERE,
- base::Bind(&PerformTerminate));
+ [[NSNotificationCenter defaultCenter]
+ postNotificationName:NSApplicationWillTerminateNotification
+ object:NSApp];
}
} // namespace browser
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698