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

Unified Diff: base/memory/memory_pressure_listener.h

Issue 1749073002: Do V8 GC ASAP if system memory is pressured (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | base/memory/memory_pressure_listener.cc » ('j') | base/observer_list_threadsafe.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/memory/memory_pressure_listener.h
diff --git a/base/memory/memory_pressure_listener.h b/base/memory/memory_pressure_listener.h
index a6ce702ccb0f68df89a80b53934a884f4463926f..b5efa494db2269687aee207c1a20ade9eae28660 100644
--- a/base/memory/memory_pressure_listener.h
+++ b/base/memory/memory_pressure_listener.h
@@ -64,9 +64,14 @@ class BASE_EXPORT MemoryPressureListener {
};
typedef base::Callback<void(MemoryPressureLevel)> MemoryPressureCallback;
+ typedef base::Callback<void(bool)> SyncMemoryPressuredCallback;
explicit MemoryPressureListener(
const MemoryPressureCallback& memory_pressure_callback);
+ explicit MemoryPressureListener(
+ const MemoryPressureCallback& memory_pressure_callback,
+ const SyncMemoryPressuredCallback& sync_memory_pressured_callback);
+
~MemoryPressureListener();
// Intended for use by the platform specific implementation.
@@ -82,11 +87,14 @@ class BASE_EXPORT MemoryPressureListener {
private:
void Notify(MemoryPressureLevel memory_pressure_level);
+ void SyncNotify(MemoryPressureLevel memory_pressure_level);
static void DoNotifyMemoryPressure(MemoryPressureLevel memory_pressure_level);
MemoryPressureCallback callback_;
+ SyncMemoryPressuredCallback sync_memory_pressured_callback_;
+
DISALLOW_COPY_AND_ASSIGN(MemoryPressureListener);
};
« no previous file with comments | « no previous file | base/memory/memory_pressure_listener.cc » ('j') | base/observer_list_threadsafe.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698