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

Unified Diff: chrome/browser/lifetime/keep_alive_registry.cc

Issue 1931503002: Add BackgroundModeOptimizer that can restart the browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@PushKeepAlive
Patch Set: address comments. disable feature by default Created 4 years, 5 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
Index: chrome/browser/lifetime/keep_alive_registry.cc
diff --git a/chrome/browser/lifetime/keep_alive_registry.cc b/chrome/browser/lifetime/keep_alive_registry.cc
index f1ed172b2c92f9140e40bc6ce28864e7dfe12da1..77c3ae3b4aaf2a337945b862a264977e709909b3 100644
--- a/chrome/browser/lifetime/keep_alive_registry.cc
+++ b/chrome/browser/lifetime/keep_alive_registry.cc
@@ -92,12 +92,14 @@ void KeepAliveRegistry::Unregister(KeepAliveOrigin origin,
bool new_keeping_alive = IsKeepingAlive();
bool new_restart_allowed = IsRestartAllowed();
- if (new_restart_allowed != old_restart_allowed)
- OnRestartAllowedChanged(new_restart_allowed);
-
+ // Update the KeepAlive state first, so that listeners can check if we are
+ // trying to shutdown.
if (new_keeping_alive != old_keeping_alive)
OnKeepAliveStateChanged(new_keeping_alive);
+ if (new_restart_allowed != old_restart_allowed)
+ OnRestartAllowedChanged(new_restart_allowed);
+
DVLOG(1) << "New state of the KeepAliveRegistry:" << *this;
}
« no previous file with comments | « chrome/browser/lifetime/browser_close_manager.cc ('k') | chrome/browser/ui/tab_contents/tab_contents_iterator_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698