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

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: Switch the flag to disabled by default Created 4 years, 7 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 853ba7105c3734027b8d3e744860a5ac8a806a03..c3a6d085060c5a4cc6473ca122d142ec6caa3080 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"
@@ -318,6 +319,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
@@ -676,6 +678,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() {

Powered by Google App Engine
This is Rietveld 408576698