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

Unified Diff: gin/v8_platform.cc

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 | « gin/public/v8_platform.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gin/v8_platform.cc
diff --git a/gin/v8_platform.cc b/gin/v8_platform.cc
index 276dd77c9d64f2dd941b9613839f1941a041d326..e74092eadc711b114cb0e05d1074fdd88280c5db 100644
--- a/gin/v8_platform.cc
+++ b/gin/v8_platform.cc
@@ -6,6 +6,7 @@
#include "base/bind.h"
#include "base/location.h"
+#include "base/memory/memory_coordinator_proxy.h"
#include "base/sys_info.h"
#include "base/threading/worker_pool.h"
#include "base/trace_event/trace_event.h"
@@ -263,4 +264,17 @@ void V8Platform::RemoveTraceStateObserver(
g_trace_state_dispatcher.Get().RemoveObserver(observer);
}
+bool V8Platform::IsGlobalMemoryBudgetAvailable() {
+ return base::MemoryCoordinatorProxy::GetInstance()->IsEnabled();
+}
+
+int64_t V8Platform::GetGlobalMemoryBudget() {
+ return base::MemoryCoordinatorProxy::GetInstance()->GetGlobalBudget();
+}
+
+void V8Platform::SetGlobalMemoryBudgetUpdateInterval(uint32_t interval) {
+ base::MemoryCoordinatorProxy::GetInstance()->SetGlobalBudgetUpdateInterval(
+ interval);
+}
+
} // namespace gin
« no previous file with comments | « gin/public/v8_platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698