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

Unified Diff: base/memory/memory_pressure_monitor_win.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_win.h
diff --git a/base/memory/memory_pressure_monitor_win.h b/base/memory/memory_pressure_monitor_win.h
index 5689ac6ac74a2befa9f2fac5d749948562953437..2d7838ccb6ca7ce58d5a028c905662de4feaa792 100644
--- a/base/memory/memory_pressure_monitor_win.h
+++ b/base/memory/memory_pressure_monitor_win.h
@@ -111,7 +111,9 @@ class BASE_EXPORT MemoryPressureMonitor : public base::MemoryPressureMonitor {
// thread.
virtual bool GetSystemMemoryStatus(MEMORYSTATUSEX* mem_status);
- private:
+ void SetDispatchCallback(DispatchCallback callback) override;
+
+private:
// Threshold amounts of available memory that trigger pressure levels. See
// memory_pressure_monitor.cc for a discussion of reasonable values for these.
int moderate_threshold_mb_;
@@ -132,6 +134,9 @@ class BASE_EXPORT MemoryPressureMonitor : public base::MemoryPressureMonitor {
// Ensures that this object is used from a single thread.
base::ThreadChecker thread_checker_;
+ DispatchCallback dispatch_callback_ =
+ &MemoryPressureListener::NotifyMemoryPressure;
+
// Weak pointer factory to ourself used for scheduling calls to
// CheckMemoryPressure/CheckMemoryPressureAndRecordStatistics via |timer_|.
base::WeakPtrFactory<MemoryPressureMonitor> weak_ptr_factory_;

Powered by Google App Engine
This is Rietveld 408576698