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

Unified Diff: base/memory/memory_pressure_monitor_chromeos.cc

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_chromeos.cc
diff --git a/base/memory/memory_pressure_monitor_chromeos.cc b/base/memory/memory_pressure_monitor_chromeos.cc
index 2d0b0a62fc6d7c1dbbb77aa98f06132d5f93a966..8880d1620b14e7bbc793cb3c8e068d9a6c79a835 100644
--- a/base/memory/memory_pressure_monitor_chromeos.cc
+++ b/base/memory/memory_pressure_monitor_chromeos.cc
@@ -230,7 +230,7 @@ void MemoryPressureMonitor::CheckMemoryPressure() {
return;
}
moderate_pressure_repeat_count_ = 0;
- MemoryPressureListener::NotifyMemoryPressure(current_memory_pressure_level_);
+ dispatch_callback_(current_memory_pressure_level_);
}
// Gets the used ChromeOS memory in percent.
@@ -271,5 +271,9 @@ int MemoryPressureMonitor::GetUsedMemoryInPercent() {
return percentage;
}
+void MemoryPressureMonitor::SetDispatchCallback(DispatchCallback callback) {
+ dispatch_callback_ = callback;
+}
+
} // namespace chromeos
} // namespace base

Powered by Google App Engine
This is Rietveld 408576698