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

Unified Diff: content/browser/memory/memory_pressure_controller.h

Issue 1362233003: Add architecture for simulating memory pressure notifications in all processes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 3 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: content/browser/memory/memory_pressure_controller.h
diff --git a/content/browser/memory/memory_pressure_controller.h b/content/browser/memory/memory_pressure_controller.h
index 848b2d41a1b6aae3615ce7f0accc51da16a90c59..6a7285be7cf7ba77486da29da47ce3f6cc617c1f 100644
--- a/content/browser/memory/memory_pressure_controller.h
+++ b/content/browser/memory/memory_pressure_controller.h
@@ -8,6 +8,7 @@
#include <set>
#include "base/callback.h"
+#include "base/memory/memory_pressure_listener.h"
#include "base/memory/singleton.h"
#include "content/common/content_export.h"
@@ -15,14 +16,18 @@ namespace content {
class MemoryMessageFilter;
+using MemoryPressureLevel = base::MemoryPressureListener::MemoryPressureLevel;
+using MemoryMessageFilterSet = std::set<scoped_refptr<MemoryMessageFilter>>;
Primiano Tucci (use gerrit) 2015/09/28 12:47:32 ditto here. ALso, this is now duplicating the alia
petrcermak 2015/09/28 15:39:32 Done.
+
class CONTENT_EXPORT MemoryPressureController {
public:
// These methods must be called on the IO thread.
void OnMemoryMessageFilterAdded(MemoryMessageFilter* filter);
void OnMemoryMessageFilterRemoved(MemoryMessageFilter* filter);
- // This method can be called from any thread.
+ // These methods can be called from any thread.
void SetPressureNotificationsSuppressedInAllProcesses(bool suppressed);
+ void SimulatePressureNotificationInAllProcesses(MemoryPressureLevel level);
// This method can be called from any thread.
static MemoryPressureController* GetInstance();
@@ -37,7 +42,6 @@ class CONTENT_EXPORT MemoryPressureController {
// Set of all memory message filters in the browser process. Always accessed
// on the IO thread.
- typedef std::set<scoped_refptr<MemoryMessageFilter>> MemoryMessageFilterSet;
MemoryMessageFilterSet memory_message_filters_;
DISALLOW_COPY_AND_ASSIGN(MemoryPressureController);

Powered by Google App Engine
This is Rietveld 408576698