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

Unified Diff: base/memory/memory_pressure_monitor_mac.h

Issue 2097753002: Make memory pressure notifier configurable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment 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: base/memory/memory_pressure_monitor_mac.h
diff --git a/base/memory/memory_pressure_monitor_mac.h b/base/memory/memory_pressure_monitor_mac.h
index b975b6ecec84ceb3dddef50fa1730fcf387ef2b4..62e0d83d0dd8d6e30de0347116d673e9049c4bdc 100644
--- a/base/memory/memory_pressure_monitor_mac.h
+++ b/base/memory/memory_pressure_monitor_mac.h
@@ -28,15 +28,21 @@ class BASE_EXPORT MemoryPressureMonitor : public base::MemoryPressureMonitor {
// Returns the currently-observed memory pressure.
MemoryPressureLevel GetCurrentPressureLevel() const override;
+ void SetDispatchCallback(DispatchCallback* callback) override;
+
private:
friend TestMemoryPressureMonitor;
static MemoryPressureLevel
MemoryPressureLevelForMacMemoryPressure(int mac_memory_pressure);
- static void NotifyMemoryPressureChanged(dispatch_source_s* event_source);
+ static void NotifyMemoryPressureChanged(dispatch_source_s* event_source,
+ DispatchCallback dispatch_callback);
ScopedDispatchObject<dispatch_source_t> memory_level_event_source_;
+ DispatchCallback dispatch_callback_ =
+ &MemoryPressureListener::NotifyMemoryPressure;
+
DISALLOW_COPY_AND_ASSIGN(MemoryPressureMonitor);
};

Powered by Google App Engine
This is Rietveld 408576698