Index: base/memory/memory_coordinator_proxy.cc |
diff --git a/base/memory/memory_coordinator_proxy.cc b/base/memory/memory_coordinator_proxy.cc |
index 7e8527504102864bc63ca70631b8ca77699cb22b..24b6d66655e0e0d1cdaf59f89b7c2f2cb0c7458f 100644 |
--- a/base/memory/memory_coordinator_proxy.cc |
+++ b/base/memory/memory_coordinator_proxy.cc |
@@ -17,14 +17,25 @@ MemoryCoordinatorProxy* MemoryCoordinatorProxy::GetInstance() { |
} |
MemoryState MemoryCoordinatorProxy::GetCurrentMemoryState() const { |
- if (!callback_) |
+ if (!getter_callback_) |
return MemoryState::NORMAL; |
- return callback_.Run(); |
+ return getter_callback_.Run(); |
+} |
+ |
+void MemoryCoordinatorProxy::SetCurrentMemoryStateForTesting( |
+ MemoryState memory_state) { |
+ DCHECK(setter_callback_); |
+ setter_callback_.Run(memory_state); |
} |
void MemoryCoordinatorProxy::SetGetCurrentMemoryStateCallback( |
GetCurrentMemoryStateCallback callback) { |
- callback_ = callback; |
+ getter_callback_ = callback; |
+} |
+ |
+void MemoryCoordinatorProxy::SetSetCurrentMemoryStateForTestingCallback( |
+ SetCurrentMemoryStateCallback callback) { |
+ setter_callback_ = callback; |
} |
} // namespace base |