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

Unified Diff: base/memory/memory_coordinator_proxy.cc

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: base/memory/memory_coordinator_proxy.cc
diff --git a/base/memory/memory_coordinator_proxy.cc b/base/memory/memory_coordinator_proxy.cc
index 24b6d66655e0e0d1cdaf59f89b7c2f2cb0c7458f..4b70472ff9a8fd5f3015ecb7a8cc4dc49d3076c2 100644
--- a/base/memory/memory_coordinator_proxy.cc
+++ b/base/memory/memory_coordinator_proxy.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/memory/memory_coordinator_proxy.h"
+#include "base/process/process_metrics.h"
namespace base {
@@ -28,6 +29,13 @@ void MemoryCoordinatorProxy::SetCurrentMemoryStateForTesting(
setter_callback_.Run(memory_state);
}
+
+int64_t MemoryCoordinatorProxy::GetRemainingGlobalBudget() const {
+ if (!get_remaining_budget_callback_)
+ return 0;
+ return get_remaining_budget_callback_.Run();
+}
+
void MemoryCoordinatorProxy::SetGetCurrentMemoryStateCallback(
GetCurrentMemoryStateCallback callback) {
getter_callback_ = callback;
@@ -38,4 +46,9 @@ void MemoryCoordinatorProxy::SetSetCurrentMemoryStateForTestingCallback(
setter_callback_ = callback;
}
+void MemoryCoordinatorProxy::SetGetRemainingGlobalBudgetCallback(
+ GetRemainingGlobalBudgetCallback get_remaining_budget_callback) {
+ get_remaining_budget_callback_ = get_remaining_budget_callback;
+}
+
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698