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

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

Issue 2180843004: Use MemoryPressureListener in MemoryCoordinator (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « no previous file | components/memory_coordinator/browser/memory_coordinator.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 51dcb5df58a42d546d5806dd855262921e7eb76a..598132d9256d4d3b17543c136c08ac22303a7193 100644
--- a/components/memory_coordinator/browser/memory_coordinator.h
+++ b/components/memory_coordinator/browser/memory_coordinator.h
@@ -5,7 +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 "base/memory/memory_pressure_listener.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"
@@ -31,17 +31,17 @@ 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_;
+ // Called when MemoryPressureListener detects memory pressure.
+ void OnMemoryPressure(
+ base::MemoryPressureListener::MemoryPressureLevel level);
// Mappings of RenderProcessHost::GetID() -> MemoryCoordinatorHandleImpl.
// A mapping is added when a renderer connects to MemoryCoordinator and
// removed automatically when a underlying binding is disconnected.
std::map<int, std::unique_ptr<MemoryCoordinatorHandleImpl>> children_;
+ base::MemoryPressureListener pressure_listener_;
+
DISALLOW_COPY_AND_ASSIGN(MemoryCoordinator);
};
« no previous file with comments | « no previous file | components/memory_coordinator/browser/memory_coordinator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698