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

Unified Diff: content/common/memory_messages.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: Address Primiano's comments 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/common/memory_messages.h
diff --git a/content/common/memory_messages.h b/content/common/memory_messages.h
index a81eaf871491fb2e8bbf1af62e69dcaca94afd3d..7fe5e8202a539e87b4bbb9071a652d8de6c90d42 100644
--- a/content/common/memory_messages.h
+++ b/content/common/memory_messages.h
@@ -8,6 +8,7 @@
// Multiply-included message header, no traditional include guard.
+#include "base/memory/memory_pressure_listener.h"
#include "ipc/ipc_message_macros.h"
#include "content/common/content_export.h"
@@ -16,7 +17,19 @@
#define IPC_MESSAGE_START MemoryMsgStart
-// Sent to all child processes to enable/disable suppressing memory
+using MemoryPressureLevel = base::MemoryPressureListener::MemoryPressureLevel;
nasko 2015/09/30 16:44:58 This line seems useless, since all usage of Memory
petrcermak 2015/09/30 18:18:36 Done.
+
+IPC_ENUM_TRAITS_VALIDATE(
+ MemoryPressureLevel,
+ (value == base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_MODERATE ||
+ value == base::MemoryPressureListener::MEMORY_PRESSURE_LEVEL_CRITICAL))
+
+// Sent to all child processes to enable/disable suppressing memory pressure
// notifications.
IPC_MESSAGE_CONTROL1(MemoryMsg_SetPressureNotificationsSuppressed,
bool /* suppressed */)
+
+// Sent to all child processes to simulate a memory pressure notification.
+IPC_MESSAGE_CONTROL1(
+ MemoryMsg_SimulatePressureNotification,
+ base::MemoryPressureListener::MemoryPressureLevel /* level */)

Powered by Google App Engine
This is Rietveld 408576698