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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 1778873002: Replace Increment/DecrementKeepAliveCount by ScopedKeepAlives (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KAObserver
Patch Set: replace the commented dcheck by a dlog Created 4 years, 9 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 | « chrome/browser/app_controller_mac.h ('k') | chrome/browser/apps/app_window_interactive_uitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/app_controller_mac.mm
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index c0a864cd8ea11745c0a46c86a54f0d5cd6fae1b8..819b204aa2b86b4d935b656bb1dfb5fcd5c80838 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -34,6 +34,8 @@
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/lifetime/application_lifetime.h"
+#include "chrome/browser/lifetime/keep_alive_types.h"
+#include "chrome/browser/lifetime/scoped_keep_alive.h"
#include "chrome/browser/mac/mac_startup_profiler.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile_info_cache_observer.h"
@@ -520,7 +522,7 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// Tell BrowserList not to keep the browser process alive. Once all the
// browsers get dealloc'd, it will stop the RunLoop and fall back into main().
- chrome::DecrementKeepAliveCount();
+ keep_alive_.reset();
// Reset all pref watching, as this object outlives the prefs system.
profilePrefRegistrar_.reset();
@@ -728,7 +730,8 @@ class AppControllerProfileObserver : public ProfileInfoCacheObserver {
// Notify BrowserList to keep the application running so it doesn't go away
// when all the browser windows get closed.
- chrome::IncrementKeepAliveCount();
+ keep_alive_.reset(new ScopedKeepAlive(KeepAliveOrigin::APP_CONTROLLER,
+ KeepAliveRestartOption::DISABLED));
[self setUpdateCheckInterval];
« no previous file with comments | « chrome/browser/app_controller_mac.h ('k') | chrome/browser/apps/app_window_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698