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

Unified Diff: content/child/memory/child_memory_coordinator_impl.h

Issue 2479673002: Expose MemoryCoordinator's global budget information. (Closed)
Patch Set: Small cleanup. Created 4 years, 1 month 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
Index: content/child/memory/child_memory_coordinator_impl.h
diff --git a/content/child/memory/child_memory_coordinator_impl.h b/content/child/memory/child_memory_coordinator_impl.h
index cee8d5a76054309f54ad86056a766a15d5262495..ff75ee8c31ba474f746a9797da2de50ae3026a4d 100644
--- a/content/child/memory/child_memory_coordinator_impl.h
+++ b/content/child/memory/child_memory_coordinator_impl.h
@@ -37,6 +37,21 @@ class CONTENT_EXPORT ChildMemoryCoordinatorImpl
// mojom::ChildMemoryCoordinator implementations:
void OnStateChange(mojom::MemoryState state) override;
+ void SetRemainingGlobalBudget(int64_t remaining_global_budget_mb) override;
+
+ // Returns the current memory state of this process.
+ mojom::MemoryState GetCurrentMemoryState() const {
+ return state_;
+ }
+
+ // Returns the remaining global budget usable in aggregate by all Chrome
+ // processes. This indicates how many MB of memory are remaining for Chrome
+ // processes to use before the memory coordinator will take efforts to reclaim
+ // memory. A negative amount indicates that the coordinator is actively trying
+ // to reclaim that much memory.
+ int64_t GetRemainingGlobalBudget() const {
+ return remaining_global_budget_mb_;
+ }
protected:
ChildMemoryCoordinatorDelegate* delegate() { return delegate_; }
@@ -48,6 +63,9 @@ class CONTENT_EXPORT ChildMemoryCoordinatorImpl
mojom::MemoryCoordinatorHandlePtr parent_;
ChildMemoryCoordinatorDelegate* delegate_;
+ mojom::MemoryState state_;
+ int64_t remaining_global_budget_mb_;
+
DISALLOW_COPY_AND_ASSIGN(ChildMemoryCoordinatorImpl);
};

Powered by Google App Engine
This is Rietveld 408576698