Index: content/browser/memory/memory_coordinator_impl.h |
diff --git a/content/browser/memory/memory_coordinator_impl.h b/content/browser/memory/memory_coordinator_impl.h |
index 6d975b389f5a48be439fc8dec6f70dbb0d7c70b4..3f119f65958c79bd03f249c8908b208c097e20ff 100644 |
--- a/content/browser/memory/memory_coordinator_impl.h |
+++ b/content/browser/memory/memory_coordinator_impl.h |
@@ -12,6 +12,8 @@ |
#include "base/threading/non_thread_safe.h" |
#include "base/time/time.h" |
#include "content/browser/memory/memory_coordinator.h" |
+#include "content/public/browser/notification_observer.h" |
+#include "content/public/browser/notification_registrar.h" |
namespace content { |
@@ -35,6 +37,7 @@ struct MemoryCoordinatorSingletonTraits; |
// back to a relaxed state. (e.g. THROTTLED -> NORMAL) |
// * Once a state is changed, it remains the same for a certain period of time. |
class CONTENT_EXPORT MemoryCoordinatorImpl : public MemoryCoordinator, |
+ public NotificationObserver, |
public base::NonThreadSafe { |
public: |
MemoryCoordinatorImpl(scoped_refptr<base::SingleThreadTaskRunner> task_runner, |
@@ -49,6 +52,11 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public MemoryCoordinator, |
base::MemoryState GetCurrentMemoryState() const override; |
+ // NotificationObserver implementation: |
+ void Observe(int type, |
+ const NotificationSource& source, |
+ const NotificationDetails& details) override; |
+ |
private: |
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, CalculateNextState); |
FRIEND_TEST_ALL_PREFIXES(MemoryCoordinatorImplTest, UpdateState); |
@@ -76,6 +84,7 @@ class CONTENT_EXPORT MemoryCoordinatorImpl : public MemoryCoordinator, |
void ScheduleUpdateState(base::TimeDelta delay); |
scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
+ NotificationRegistrar notification_registrar_; |
std::unique_ptr<MemoryMonitor> memory_monitor_; |
base::Closure update_state_callback_; |
base::MemoryState current_state_ = MemoryState::NORMAL; |