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

Unified Diff: base/memory/memory_pressure_monitor.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.h
diff --git a/base/memory/memory_pressure_monitor.h b/base/memory/memory_pressure_monitor.h
index 6073bd3f44ca8f26b953a31967406c747e35bb58..f345b6738b9190d0541bf7ef646e7269029e0c91 100644
--- a/base/memory/memory_pressure_monitor.h
+++ b/base/memory/memory_pressure_monitor.h
@@ -23,6 +23,7 @@ namespace base {
class BASE_EXPORT MemoryPressureMonitor {
public:
using MemoryPressureLevel = base::MemoryPressureListener::MemoryPressureLevel;
+ using DispatchCallback = void(*)(MemoryPressureLevel level);
danakj 2016/07/08 00:03:53 oh I was expecting a base::Callback, but if you do
bashi 2016/07/08 00:13:05 Ah, good point. I have a WIP CL locally and a func
virtual ~MemoryPressureMonitor();
@@ -32,6 +33,10 @@ class BASE_EXPORT MemoryPressureMonitor {
// Returns the currently observed memory pressure.
virtual MemoryPressureLevel GetCurrentPressureLevel() const = 0;
+ // Sets a notification callback. The default callback invokes
+ // base::MemoryPressureListener::NotifyMemoryPressure.
+ virtual void SetDispatchCallback(DispatchCallback callback) = 0;
+
protected:
MemoryPressureMonitor();
« no previous file with comments | « no previous file | base/memory/memory_pressure_monitor_chromeos.h » ('j') | base/memory/memory_pressure_monitor_chromeos.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698