OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 // Common IPC messages used for child processes. | 5 // Common IPC messages used for child processes. |
6 // Multiply-included message file, hence no include guard. | 6 // Multiply-included message file, hence no include guard. |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/memory/shared_memory.h" | 11 #include "base/memory/shared_memory.h" |
12 #include "base/tracked_objects.h" | 12 #include "base/tracked_objects.h" |
13 #include "base/values.h" | 13 #include "base/values.h" |
14 #include "cc/resources/shared_bitmap_manager.h" | 14 #include "cc/resources/shared_bitmap_manager.h" |
15 #include "content/common/content_export.h" | 15 #include "content/common/content_export.h" |
16 #include "content/common/host_discardable_shared_memory_manager.h" | 16 #include "content/common/host_discardable_shared_memory_manager.h" |
17 #include "ipc/ipc_message_macros.h" | 17 #include "ipc/ipc_message_macros.h" |
18 #include "ui/gfx/gpu_memory_buffer.h" | 18 #include "ui/gfx/gpu_memory_buffer.h" |
| 19 #include "ui/gfx/ipc/gfx_param_traits.h" |
19 | 20 |
20 #if defined(OS_MACOSX) | 21 #if defined(OS_MACOSX) |
21 #include "content/common/mac/io_surface_manager_token.h" | 22 #include "content/common/mac/io_surface_manager_token.h" |
22 #endif | 23 #endif |
23 | 24 |
24 IPC_ENUM_TRAITS_MAX_VALUE(tracked_objects::ThreadData::Status, | 25 IPC_ENUM_TRAITS_MAX_VALUE(tracked_objects::ThreadData::Status, |
25 tracked_objects::ThreadData::STATUS_LAST) | 26 tracked_objects::ThreadData::STATUS_LAST) |
26 | 27 |
27 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::LocationSnapshot) | 28 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::LocationSnapshot) |
28 IPC_STRUCT_TRAITS_MEMBER(file_name) | 29 IPC_STRUCT_TRAITS_MEMBER(file_name) |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
62 | 63 |
63 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, | 64 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, |
64 gfx::GPU_MEMORY_BUFFER_TYPE_LAST) | 65 gfx::GPU_MEMORY_BUFFER_TYPE_LAST) |
65 | 66 |
66 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle) | 67 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle) |
67 IPC_STRUCT_TRAITS_MEMBER(id) | 68 IPC_STRUCT_TRAITS_MEMBER(id) |
68 IPC_STRUCT_TRAITS_MEMBER(type) | 69 IPC_STRUCT_TRAITS_MEMBER(type) |
69 IPC_STRUCT_TRAITS_MEMBER(handle) | 70 IPC_STRUCT_TRAITS_MEMBER(handle) |
70 IPC_STRUCT_TRAITS_END() | 71 IPC_STRUCT_TRAITS_END() |
71 | 72 |
72 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBuffer::Format, | |
73 gfx::GpuMemoryBuffer::FORMAT_LAST) | |
74 | |
75 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBuffer::Usage, | |
76 gfx::GpuMemoryBuffer::USAGE_LAST) | |
77 | |
78 #undef IPC_MESSAGE_EXPORT | 73 #undef IPC_MESSAGE_EXPORT |
79 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 74 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
80 | 75 |
81 #define IPC_MESSAGE_START ChildProcessMsgStart | 76 #define IPC_MESSAGE_START ChildProcessMsgStart |
82 | 77 |
83 // Messages sent from the browser to the child process. | 78 // Messages sent from the browser to the child process. |
84 | 79 |
85 // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child | 80 // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child |
86 // process that it's safe to shutdown. | 81 // process that it's safe to shutdown. |
87 IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) | 82 IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 #if defined(USE_TCMALLOC) | 181 #if defined(USE_TCMALLOC) |
187 // Reply to ChildProcessMsg_GetTcmallocStats. | 182 // Reply to ChildProcessMsg_GetTcmallocStats. |
188 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_TcmallocStats, | 183 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_TcmallocStats, |
189 std::string /* output */) | 184 std::string /* output */) |
190 #endif | 185 #endif |
191 | 186 |
192 // Asks the browser to create a gpu memory buffer. | 187 // Asks the browser to create a gpu memory buffer. |
193 IPC_SYNC_MESSAGE_CONTROL4_1(ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer, | 188 IPC_SYNC_MESSAGE_CONTROL4_1(ChildProcessHostMsg_SyncAllocateGpuMemoryBuffer, |
194 uint32 /* width */, | 189 uint32 /* width */, |
195 uint32 /* height */, | 190 uint32 /* height */, |
196 gfx::GpuMemoryBuffer::Format, | 191 gfx::BufferFormat, |
197 gfx::GpuMemoryBuffer::Usage, | 192 gfx::BufferUsage, |
198 gfx::GpuMemoryBufferHandle) | 193 gfx::GpuMemoryBufferHandle) |
199 | 194 |
200 // Informs the browser that the child deleted a gpu memory buffer. | 195 // Informs the browser that the child deleted a gpu memory buffer. |
201 IPC_MESSAGE_CONTROL2(ChildProcessHostMsg_DeletedGpuMemoryBuffer, | 196 IPC_MESSAGE_CONTROL2(ChildProcessHostMsg_DeletedGpuMemoryBuffer, |
202 gfx::GpuMemoryBufferId, | 197 gfx::GpuMemoryBufferId, |
203 uint32 /* sync_point */) | 198 uint32 /* sync_point */) |
204 | 199 |
205 // Asks the browser to create a block of discardable shared memory for the | 200 // Asks the browser to create a block of discardable shared memory for the |
206 // child process. | 201 // child process. |
207 IPC_SYNC_MESSAGE_CONTROL2_1( | 202 IPC_SYNC_MESSAGE_CONTROL2_1( |
208 ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory, | 203 ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory, |
209 uint32 /* size */, | 204 uint32 /* size */, |
210 content::DiscardableSharedMemoryId, | 205 content::DiscardableSharedMemoryId, |
211 base::SharedMemoryHandle) | 206 base::SharedMemoryHandle) |
212 | 207 |
213 // Informs the browser that the child deleted a block of discardable shared | 208 // Informs the browser that the child deleted a block of discardable shared |
214 // memory. | 209 // memory. |
215 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_DeletedDiscardableSharedMemory, | 210 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_DeletedDiscardableSharedMemory, |
216 content::DiscardableSharedMemoryId) | 211 content::DiscardableSharedMemoryId) |
OLD | NEW |