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

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

Issue 1725883002: Add KeepAliveStateObserver, add the Restart option (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@KeepAlive
Patch Set: Created 4 years, 10 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.h
diff --git a/chrome/browser/lifetime/keep_alive_registry.h b/chrome/browser/lifetime/keep_alive_registry.h
index 321e747014f8224568b6d429328932e388b5d52c..09053912c2e65e38caf0e608d5b1f773cd7b352a 100644
--- a/chrome/browser/lifetime/keep_alive_registry.h
+++ b/chrome/browser/lifetime/keep_alive_registry.h
@@ -11,11 +11,14 @@
#include "base/memory/singleton.h"
struct KeepAliveOptions;
+class KeepAliveStateObserver;
class KeepAliveRegistry {
public:
static KeepAliveRegistry* GetInstance();
+ void SetObserver(KeepAliveStateObserver* observer);
+
private:
friend struct base::DefaultSingletonTraits<KeepAliveRegistry>;
// Friend to be able to use Register/Unregister
@@ -28,7 +31,14 @@ class KeepAliveRegistry {
void Register(const KeepAliveOptions* options);
void Unregister(const KeepAliveOptions* options);
+ void DumpCurrentState() const;
+ KeepAliveOptions ComputeCurrentState() const;
+ void NotifyOfStateDifferences(const KeepAliveOptions& previous_state) const;
+
+ KeepAliveStateObserver* observer_;
+
std::multiset<const KeepAliveOptions*> registered_keep_alives_;
+ std::multiset<const KeepAliveOptions*> restart_allowed_keep_alives_;
DISALLOW_COPY_AND_ASSIGN(KeepAliveRegistry);
};

Powered by Google App Engine
This is Rietveld 408576698