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

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

Issue 2669323002: Add ChildMemoryCoordinator::PurgeMemory() (Closed)
Patch Set: Created 3 years, 11 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 e961c6bcdd2b120b6e3dff01e30b9895d6fa6dbb..037780985f74e275a9ef31ecfda7802b68fd5c0c 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("memory-infra", "ChildMemoryCoordinatorImpl::OnStateChange",

Powered by Google App Engine
This is Rietveld 408576698