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

Unified Diff: components/memory_coordinator/browser/memory_coordinator.h

Issue 2150783003: Add memory pressure dispatching callback to MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mc-3-client
Patch Set: rebase Created 4 years, 5 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: components/memory_coordinator/browser/memory_coordinator.h
diff --git a/components/memory_coordinator/browser/memory_coordinator.h b/components/memory_coordinator/browser/memory_coordinator.h
index 3cf4fb585904e092512971d40ea0d1ad053c3894..51dcb5df58a42d546d5806dd855262921e7eb76a 100644
--- a/components/memory_coordinator/browser/memory_coordinator.h
+++ b/components/memory_coordinator/browser/memory_coordinator.h
@@ -5,6 +5,7 @@
#ifndef COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_H_
#define COMPONENTS_MEMORY_COORDINATOR_BROWSER_MEMORY_COORDINATOR_H_
+#include "base/memory/memory_pressure_monitor.h"
#include "components/memory_coordinator/common/client_registry.h"
#include "components/memory_coordinator/public/interfaces/memory_coordinator.mojom.h"
#include "mojo/public/cpp/bindings/binding.h"
@@ -30,6 +31,12 @@ class MemoryCoordinator : public ClientRegistry {
private:
void OnConnectionError(int render_process_id);
+ // Called when MemoryPressureMonitor detects memory pressure.
+ void OnMemoryPressure(base::MemoryPressureMonitor::MemoryPressureLevel level);
+
+ // A callback invoked when MemoryPressureMonitor detects memory pressure.
+ base::MemoryPressureMonitor::DispatchCallback pressure_level_dispatcher_;
+
// Mappings of RenderProcessHost::GetID() -> MemoryCoordinatorHandleImpl.
// A mapping is added when a renderer connects to MemoryCoordinator and
// removed automatically when a underlying binding is disconnected.
« no previous file with comments | « components/memory_coordinator/browser/BUILD.gn ('k') | components/memory_coordinator/browser/memory_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698