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

Unified Diff: chrome/browser/background/background_mode_manager.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/background/background_mode_manager.cc
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index daf22d28894c0dfb35777c083284576b4abc0204..e41b14bc34affc4b34fd509466d2f5df8cc8a55a 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -23,6 +23,7 @@
#include "build/build_config.h"
#include "chrome/app/chrome_command_ids.h"
#include "chrome/browser/background/background_application_list_model.h"
+#include "chrome/browser/background/background_mode_optimizer.h"
#include "chrome/browser/background/background_trigger.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browser_shutdown.h"
@@ -92,6 +93,9 @@ void RecordMenuItemClick(MenuItem item) {
}
} // namespace
+// static
+bool BackgroundModeManager::should_restart_in_background_ = false;
+
BackgroundModeManager::BackgroundModeData::BackgroundModeData(
Profile* profile,
CommandIdHandlerVector* command_id_handler_vector)
@@ -318,6 +322,7 @@ BackgroundModeManager::BackgroundModeManager(
// in a mode that doesn't open a browser window. It will be resumed when the
// first browser window is opened.
SuspendBackgroundMode();
+ optimizer_ = BackgroundModeOptimizer::Create();
}
// If the -keep-alive-for-test flag is passed, then always keep chrome running
@@ -671,6 +676,7 @@ void BackgroundModeManager::ExecuteCommand(int command_id, int event_flags) {
// BackgroundModeManager, private
void BackgroundModeManager::ReleaseStartupKeepAliveCallback() {
keep_alive_for_startup_.reset();
+ optimizer_ = BackgroundModeOptimizer::Create();
}
void BackgroundModeManager::ReleaseStartupKeepAlive() {
« no previous file with comments | « chrome/browser/background/background_mode_manager.h ('k') | chrome/browser/background/background_mode_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698