| 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 <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/memory/shared_memory.h" | 13 #include "base/memory/shared_memory.h" |
| 14 #include "base/tracked_objects.h" | 14 #include "base/tracked_objects.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "cc/resources/shared_bitmap_manager.h" | 17 #include "cc/resources/shared_bitmap_manager.h" |
| 18 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 19 #include "content/common/content_param_traits_macros.h" |
| 20 #include "content/common/gpu/gpu_param_traits_macros.h" |
| 21 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 19 #include "content/common/host_discardable_shared_memory_manager.h" | 22 #include "content/common/host_discardable_shared_memory_manager.h" |
| 20 #include "gpu/command_buffer/common/sync_token.h" | 23 #include "gpu/command_buffer/common/sync_token.h" |
| 24 #include "ipc/ipc_channel_handle.h" |
| 21 #include "ipc/ipc_message_macros.h" | 25 #include "ipc/ipc_message_macros.h" |
| 22 #include "ipc/ipc_platform_file.h" | 26 #include "ipc/ipc_platform_file.h" |
| 23 #include "ui/gfx/gpu_memory_buffer.h" | 27 #include "ui/gfx/gpu_memory_buffer.h" |
| 24 #include "ui/gfx/ipc/gfx_param_traits.h" | 28 #include "ui/gfx/ipc/gfx_param_traits.h" |
| 25 | 29 |
| 30 IPC_ENUM_TRAITS_MAX_VALUE(content::CauseForGpuLaunch, |
| 31 content::CAUSE_FOR_GPU_LAUNCH_MAX_ENUM - 1) |
| 32 |
| 26 IPC_ENUM_TRAITS_MAX_VALUE(tracked_objects::ThreadData::Status, | 33 IPC_ENUM_TRAITS_MAX_VALUE(tracked_objects::ThreadData::Status, |
| 27 tracked_objects::ThreadData::STATUS_LAST) | 34 tracked_objects::ThreadData::STATUS_LAST) |
| 28 | 35 |
| 29 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::LocationSnapshot) | 36 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::LocationSnapshot) |
| 30 IPC_STRUCT_TRAITS_MEMBER(file_name) | 37 IPC_STRUCT_TRAITS_MEMBER(file_name) |
| 31 IPC_STRUCT_TRAITS_MEMBER(function_name) | 38 IPC_STRUCT_TRAITS_MEMBER(function_name) |
| 32 IPC_STRUCT_TRAITS_MEMBER(line_number) | 39 IPC_STRUCT_TRAITS_MEMBER(line_number) |
| 33 IPC_STRUCT_TRAITS_END() | 40 IPC_STRUCT_TRAITS_END() |
| 34 | 41 |
| 35 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::BirthOnThreadSnapshot) | 42 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::BirthOnThreadSnapshot) |
| (...skipping 19 matching lines...) Expand all Loading... |
| 55 | 62 |
| 56 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::ProcessDataPhaseSnapshot) | 63 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::ProcessDataPhaseSnapshot) |
| 57 IPC_STRUCT_TRAITS_MEMBER(tasks) | 64 IPC_STRUCT_TRAITS_MEMBER(tasks) |
| 58 IPC_STRUCT_TRAITS_END() | 65 IPC_STRUCT_TRAITS_END() |
| 59 | 66 |
| 60 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::ProcessDataSnapshot) | 67 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::ProcessDataSnapshot) |
| 61 IPC_STRUCT_TRAITS_MEMBER(phased_snapshots) | 68 IPC_STRUCT_TRAITS_MEMBER(phased_snapshots) |
| 62 IPC_STRUCT_TRAITS_MEMBER(process_id) | 69 IPC_STRUCT_TRAITS_MEMBER(process_id) |
| 63 IPC_STRUCT_TRAITS_END() | 70 IPC_STRUCT_TRAITS_END() |
| 64 | 71 |
| 65 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, | |
| 66 gfx::GPU_MEMORY_BUFFER_TYPE_LAST) | |
| 67 | |
| 68 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle) | |
| 69 IPC_STRUCT_TRAITS_MEMBER(id) | |
| 70 IPC_STRUCT_TRAITS_MEMBER(type) | |
| 71 IPC_STRUCT_TRAITS_MEMBER(handle) | |
| 72 IPC_STRUCT_TRAITS_MEMBER(offset) | |
| 73 IPC_STRUCT_TRAITS_MEMBER(stride) | |
| 74 #if defined(USE_OZONE) | |
| 75 IPC_STRUCT_TRAITS_MEMBER(native_pixmap_handle) | |
| 76 #elif defined(OS_MACOSX) | |
| 77 IPC_STRUCT_TRAITS_MEMBER(mach_port) | |
| 78 #endif | |
| 79 IPC_STRUCT_TRAITS_END() | |
| 80 | |
| 81 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferId) | |
| 82 IPC_STRUCT_TRAITS_MEMBER(id) | |
| 83 IPC_STRUCT_TRAITS_END() | |
| 84 | |
| 85 #undef IPC_MESSAGE_EXPORT | 72 #undef IPC_MESSAGE_EXPORT |
| 86 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 73 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 87 | 74 |
| 88 #define IPC_MESSAGE_START ChildProcessMsgStart | 75 #define IPC_MESSAGE_START ChildProcessMsgStart |
| 89 | 76 |
| 90 // Messages sent from the browser to the child process. | 77 // Messages sent from the browser to the child process. |
| 91 | 78 |
| 92 // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child | 79 // Sent in response to ChildProcessHostMsg_ShutdownRequest to tell the child |
| 93 // process that it's safe to shutdown. | 80 // process that it's safe to shutdown. |
| 94 IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) | 81 IPC_MESSAGE_CONTROL0(ChildProcessMsg_Shutdown) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 115 |
| 129 #if defined(USE_OZONE) | 116 #if defined(USE_OZONE) |
| 130 // Sent to child processes to initialize ClientNativePixmapFactory using | 117 // Sent to child processes to initialize ClientNativePixmapFactory using |
| 131 // a device file descriptor. | 118 // a device file descriptor. |
| 132 IPC_MESSAGE_CONTROL1(ChildProcessMsg_InitializeClientNativePixmapFactory, | 119 IPC_MESSAGE_CONTROL1(ChildProcessMsg_InitializeClientNativePixmapFactory, |
| 133 base::FileDescriptor /* device_fd */) | 120 base::FileDescriptor /* device_fd */) |
| 134 #endif | 121 #endif |
| 135 //////////////////////////////////////////////////////////////////////////////// | 122 //////////////////////////////////////////////////////////////////////////////// |
| 136 // Messages sent from the child process to the browser. | 123 // Messages sent from the child process to the browser. |
| 137 | 124 |
| 125 // A renderer sends this when it wants to create a connection to the GPU |
| 126 // process. The browser will create the GPU process if necessary, and will |
| 127 // return a handle to the channel via a GpuChannelEstablished message. |
| 128 IPC_SYNC_MESSAGE_CONTROL1_3(ChildProcessHostMsg_EstablishGpuChannel, |
| 129 content::CauseForGpuLaunch, |
| 130 int /* client id */, |
| 131 IPC::ChannelHandle /* handle to channel */, |
| 132 gpu::GPUInfo /* stats about GPU process*/) |
| 133 |
| 134 // A renderer sends this when it wants to know whether a gpu process exists. |
| 135 IPC_SYNC_MESSAGE_CONTROL0_1(ChildProcessHostMsg_HasGpuProcess, |
| 136 bool /* result */) |
| 137 |
| 138 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) | 138 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) |
| 139 | 139 |
| 140 // Send back profiler data (ThreadData in tracked_objects). | 140 // Send back profiler data (ThreadData in tracked_objects). |
| 141 IPC_MESSAGE_CONTROL2( | 141 IPC_MESSAGE_CONTROL2( |
| 142 ChildProcessHostMsg_ChildProfilerData, | 142 ChildProcessHostMsg_ChildProfilerData, |
| 143 int, /* sequence_number */ | 143 int, /* sequence_number */ |
| 144 tracked_objects::ProcessDataSnapshot /* process_data_snapshot */) | 144 tracked_objects::ProcessDataSnapshot /* process_data_snapshot */) |
| 145 | 145 |
| 146 // Send back histograms as vector of pickled-histogram strings. | 146 // Send back histograms as vector of pickled-histogram strings. |
| 147 IPC_MESSAGE_CONTROL2(ChildProcessHostMsg_ChildHistogramData, | 147 IPC_MESSAGE_CONTROL2(ChildProcessHostMsg_ChildHistogramData, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 207 IPC_SYNC_MESSAGE_CONTROL2_1( | 207 IPC_SYNC_MESSAGE_CONTROL2_1( |
| 208 ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory, | 208 ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory, |
| 209 uint32_t /* size */, | 209 uint32_t /* size */, |
| 210 content::DiscardableSharedMemoryId, | 210 content::DiscardableSharedMemoryId, |
| 211 base::SharedMemoryHandle) | 211 base::SharedMemoryHandle) |
| 212 | 212 |
| 213 // Informs the browser that the child deleted a block of discardable shared | 213 // Informs the browser that the child deleted a block of discardable shared |
| 214 // memory. | 214 // memory. |
| 215 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_DeletedDiscardableSharedMemory, | 215 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_DeletedDiscardableSharedMemory, |
| 216 content::DiscardableSharedMemoryId) | 216 content::DiscardableSharedMemoryId) |
| OLD | NEW |