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

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: 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..f013b68d77338295bbc7735c0f9a3ad19414e4a2 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,18 @@
#define IPC_MESSAGE_START MemoryMsgStart
-// Sent to all child processes to enable/disable suppressing memory
+using MemoryPressureLevel = base::MemoryPressureListener::MemoryPressureLevel;
+
+IPC_ENUM_TRAITS_VALIDATE(
+ MemoryPressureLevel,
+ (value == MemoryPressureLevel::MEMORY_PRESSURE_LEVEL_MODERATE ||
+ value == MemoryPressureLevel::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,
+ MemoryPressureLevel /* level */)

Powered by Google App Engine
This is Rietveld 408576698