Index: base/memory/memory_coordinator_proxy.h |
diff --git a/base/memory/memory_coordinator_proxy.h b/base/memory/memory_coordinator_proxy.h |
index 22a65324a64c8444a68fe649df480f8915270776..4148da5dceec0c59e39462a6f740569263432ba9 100644 |
--- a/base/memory/memory_coordinator_proxy.h |
+++ b/base/memory/memory_coordinator_proxy.h |
@@ -12,27 +12,36 @@ |
namespace base { |
-// The proxy of MemoryCoordinator to be accessed from components that is not |
+// The proxy of MemoryCoordinator to be accessed from components that are not |
// in content/browser e.g. net. |
class BASE_EXPORT MemoryCoordinatorProxy { |
public: |
using GetCurrentMemoryStateCallback = base::Callback<MemoryState()>; |
+ using SetCurrentMemoryStateCallback = base::Callback<void(MemoryState)>; |
static MemoryCoordinatorProxy* GetInstance(); |
// Returns the current memory state. |
MemoryState GetCurrentMemoryState() const; |
+ // Sets the current memory state. This function is for testing only. |
+ void SetCurrentMemoryStateForTesting(MemoryState memory_state); |
+ |
// Sets state-getter callback. |
void SetGetCurrentMemoryStateCallback(GetCurrentMemoryStateCallback callback); |
+ // Sets state-setter callback. |
+ void SetSetCurrentMemoryStateForTestingCallback( |
+ SetCurrentMemoryStateCallback callback); |
+ |
private: |
friend struct base::DefaultSingletonTraits<MemoryCoordinatorProxy>; |
MemoryCoordinatorProxy(); |
virtual ~MemoryCoordinatorProxy(); |
- GetCurrentMemoryStateCallback callback_; |
+ GetCurrentMemoryStateCallback getter_callback_; |
+ SetCurrentMemoryStateCallback setter_callback_; |
DISALLOW_COPY_AND_ASSIGN(MemoryCoordinatorProxy); |
}; |