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

Unified Diff: chrome/browser/background/background_mode_manager.h

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.h
diff --git a/chrome/browser/background/background_mode_manager.h b/chrome/browser/background/background_mode_manager.h
index 986863df5d5bf078f00594fc4f26283e9cd4bbe3..3b857f87d9ef1c6f0fc9576373ebbf3a8c891656 100644
--- a/chrome/browser/background/background_mode_manager.h
+++ b/chrome/browser/background/background_mode_manager.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_BACKGROUND_BACKGROUND_MODE_MANAGER_H_
#include <map>
+#include <memory>
#include <set>
#include <vector>
@@ -26,6 +27,7 @@
#include "content/public/browser/notification_registrar.h"
#include "extensions/common/extension.h"
+class BackgroundModeOptimizer;
class BackgroundTrigger;
class Browser;
class PrefRegistrySimple;
@@ -87,6 +89,10 @@ class BackgroundModeManager
// will not start it if it is not enabled.
virtual void ResumeBackgroundMode();
+ // Invoked to take Chrome out of KeepAlive mode - chrome stops running in
Bernhard Bauer 2016/05/19 08:56:56 Nit: capitalize "Chrome".
dgn 2016/06/20 17:45:18 Done.
+ // the background and removes its status bar icon.
+ void EndBackgroundMode();
sky 2016/05/18 19:23:05 Move implementation to match new position.
dgn 2016/06/20 17:45:18 Made this private as it was before, introduced ano
+
// For testing purposes.
int NumberOfBackgroundModeData();
@@ -310,10 +316,6 @@ class BackgroundModeManager
// and has a status bar icon.
void StartBackgroundMode();
- // Invoked to take Chrome out of KeepAlive mode - chrome stops running in
- // the background and removes its status bar icon.
- void EndBackgroundMode();
-
// Enables keep alive and the status tray icon if and only if background mode
// is active and not suspended.
virtual void UpdateKeepAliveAndTrayIcon();
@@ -427,6 +429,10 @@ class BackgroundModeManager
// chrome would immediately exit due to having no open windows.
std::unique_ptr<ScopedKeepAlive> keep_alive_for_startup_;
+ // Reference to the optimizer to use to reduce Chrome's footprint when in
+ // background mode. If null, optimizations are disabled.
+ std::unique_ptr<BackgroundModeOptimizer> optimizer_;
+
// Set to true when Chrome is running with the --keep-alive-for-test flag
// (used for testing background mode without having to install a background
// app).

Powered by Google App Engine
This is Rietveld 408576698