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

Unified Diff: base/memory/memory_coordinator_proxy.h

Issue 2448953002: Add MemoryCoordinatorProxy::SetCurrentMemoryStateForTesting (Closed)
Patch Set: Add tests Created 4 years, 2 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
« no previous file with comments | « no previous file | base/memory/memory_coordinator_proxy.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « no previous file | base/memory/memory_coordinator_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698