Index: content/browser/memory/memory_coordinator.cc |
diff --git a/content/browser/memory/memory_coordinator.cc b/content/browser/memory/memory_coordinator.cc |
index 52ee2ece71f8a47def79edd5401bd9c791680b49..e6d0a660c3547b2fc4d223651bc5796e1a741373 100644 |
--- a/content/browser/memory/memory_coordinator.cc |
+++ b/content/browser/memory/memory_coordinator.cc |
@@ -41,7 +41,8 @@ MemoryCoordinator* MemoryCoordinator::GetInstance() { |
base::LeakySingletonTraits<MemoryCoordinator>>::get(); |
} |
-MemoryCoordinator::MemoryCoordinator() {} |
+MemoryCoordinator::MemoryCoordinator() |
+ : client_memory_state_(base::MemoryState::NORMAL) {} |
MemoryCoordinator::~MemoryCoordinator() {} |
@@ -81,6 +82,11 @@ bool MemoryCoordinator::SetMemoryState(int render_process_id, |
return true; |
} |
+void MemoryCoordinator::SetClientMemoryState(base::MemoryState memory_state) { |
haraken
2016/10/12 08:11:45
Who are you assuming calls this method?
Also Chri
|
+ client_memory_state_ = memory_state; |
+ base::MemoryCoordinatorClientRegistry::GetInstance()->Notify(memory_state); |
+} |
+ |
mojom::MemoryState MemoryCoordinator::GetMemoryState( |
int render_process_id) const { |
auto iter = children_.find(render_process_id); |
@@ -89,6 +95,10 @@ mojom::MemoryState MemoryCoordinator::GetMemoryState( |
return iter->second.memory_state; |
} |
+base::MemoryState MemoryCoordinator::GetClientMemoryState() const { |
+ return client_memory_state_; |
+} |
+ |
void MemoryCoordinator::AddChildForTesting( |
int dummy_render_process_id, mojom::ChildMemoryCoordinatorPtr child) { |
mojom::MemoryCoordinatorHandlePtr mch; |