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

Unified Diff: base/memory/memory_coordinator_proxy.h

Issue 2731913002: NotForReview: Expose the global memory budget (chromium side)
Patch Set: Add --simulate-memory-pressure Created 3 years, 9 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 2bb26c451c01c5a205ad5a1a795d60900ea263a5..53d443be5a1ff0cee2e34a87fa8df36004b56c42 100644
--- a/base/memory/memory_coordinator_proxy.h
+++ b/base/memory/memory_coordinator_proxy.h
@@ -19,6 +19,8 @@ class BASE_EXPORT MemoryCoordinator {
virtual ~MemoryCoordinator() {}
virtual MemoryState GetCurrentMemoryState() const = 0;
+ virtual int64_t GetGlobalBudget() = 0;
+ virtual void SetGlobalBudgetUpdateInterval(uint32_t interval_ms) = 0;
};
// The proxy of MemoryCoordinator to be accessed from components that are not
@@ -35,6 +37,17 @@ class BASE_EXPORT MemoryCoordinatorProxy {
// Returns the current memory state.
MemoryState GetCurrentMemoryState() const;
+ // Returns the current global memory budget. A negative value can be returned
+ // if the global budget is unknown or the system is under high memory
+ // pressure.
+ int64_t GetGlobalBudget() const;
+
+ // TODO(bashi): Tentative.
+ void SetGlobalBudgetUpdateInterval(uint32_t interval_ms);
+
+ // Returns true when an instance of MemoryCoordinator is set.
+ bool IsEnabled();
+
private:
friend struct base::DefaultSingletonTraits<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