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

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

Issue 2669323002: Add ChildMemoryCoordinator::PurgeMemory() (Closed)
Patch Set: rebase Created 3 years, 10 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
Index: content/child/memory/child_memory_coordinator_impl.cc
diff --git a/content/child/memory/child_memory_coordinator_impl.cc b/content/child/memory/child_memory_coordinator_impl.cc
index d052ab0e10888e978fd7690cfacd013ab4cd5fa5..7724519a16a8224a3d8097490515ee52d25c1a29 100644
--- a/content/child/memory/child_memory_coordinator_impl.cc
+++ b/content/child/memory/child_memory_coordinator_impl.cc
@@ -58,6 +58,14 @@ ChildMemoryCoordinatorImpl::~ChildMemoryCoordinatorImpl() {
g_child_memory_coordinator = nullptr;
}
+void ChildMemoryCoordinatorImpl::PurgeMemory() {
+ base::MemoryCoordinatorClientRegistry::GetInstance()->PurgeMemory();
+ // TODO(bashi): Remove following notification when all clients implement
+ // OnPurgeMemory();
+ base::MemoryCoordinatorClientRegistry::GetInstance()->Notify(
+ base::MemoryState::SUSPENDED);
+}
+
void ChildMemoryCoordinatorImpl::OnStateChange(mojom::MemoryState state) {
base::MemoryState base_state = ToBaseMemoryState(state);
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("memory-infra"),

Powered by Google App Engine
This is Rietveld 408576698