OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file contains IPC messages for controlling memory pressure handling | 5 // This file contains IPC messages for controlling memory pressure handling |
6 // in child processes for the purposes of enforcing consistent conditions | 6 // in child processes for the purposes of enforcing consistent conditions |
7 // across memory measurements. | 7 // across memory measurements. |
8 | 8 |
9 // Multiply-included message header, no traditional include guard. | 9 // Multiply-included message header, no traditional include guard. |
10 | 10 |
| 11 #include "base/memory/memory_pressure_listener.h" |
11 #include "ipc/ipc_message_macros.h" | 12 #include "ipc/ipc_message_macros.h" |
12 #include "content/common/content_export.h" | 13 #include "content/common/content_export.h" |
13 | 14 |
14 #undef IPC_MESSAGE_EXPORT | 15 #undef IPC_MESSAGE_EXPORT |
15 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 16 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
16 | 17 |
17 #define IPC_MESSAGE_START MemoryMsgStart | 18 #define IPC_MESSAGE_START MemoryMsgStart |
18 | 19 |
19 // Sent to all child processes to enable/disable suppressing memory | 20 using MemoryPressureLevel = base::MemoryPressureListener::MemoryPressureLevel; |
| 21 |
| 22 IPC_ENUM_TRAITS_VALIDATE( |
| 23 MemoryPressureLevel, |
| 24 (value == MemoryPressureLevel::MEMORY_PRESSURE_LEVEL_MODERATE || |
| 25 value == MemoryPressureLevel::MEMORY_PRESSURE_LEVEL_CRITICAL)) |
| 26 |
| 27 // Sent to all child processes to enable/disable suppressing memory pressure |
20 // notifications. | 28 // notifications. |
21 IPC_MESSAGE_CONTROL1(MemoryMsg_SetPressureNotificationsSuppressed, | 29 IPC_MESSAGE_CONTROL1(MemoryMsg_SetPressureNotificationsSuppressed, |
22 bool /* suppressed */) | 30 bool /* suppressed */) |
| 31 |
| 32 // Sent to all child processes to simulate a memory pressure notification. |
| 33 IPC_MESSAGE_CONTROL1(MemoryMsg_SimulatePressureNotification, |
| 34 MemoryPressureLevel /* level */) |
OLD | NEW |