 Chromium Code Reviews
 Chromium Code Reviews Issue 1137453002:
  content: Pass IOSurface references using Mach IPC.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1137453002:
  content: Pass IOSurface references using Mach IPC.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| 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 | 19 | 
| 20 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
| 
Robert Sesek
2015/06/01 21:58:07
Same bit about IOS.
 
reveman
2015/06/02 22:48:07
Done.
 | |
| 21 #include "content/common/mac/io_surface_manager_token.h" | |
| 22 #endif | |
| 23 | |
| 20 IPC_ENUM_TRAITS_MAX_VALUE(tracked_objects::ThreadData::Status, | 24 IPC_ENUM_TRAITS_MAX_VALUE(tracked_objects::ThreadData::Status, | 
| 21 tracked_objects::ThreadData::STATUS_LAST) | 25 tracked_objects::ThreadData::STATUS_LAST) | 
| 22 | 26 | 
| 23 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::LocationSnapshot) | 27 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::LocationSnapshot) | 
| 24 IPC_STRUCT_TRAITS_MEMBER(file_name) | 28 IPC_STRUCT_TRAITS_MEMBER(file_name) | 
| 25 IPC_STRUCT_TRAITS_MEMBER(function_name) | 29 IPC_STRUCT_TRAITS_MEMBER(function_name) | 
| 26 IPC_STRUCT_TRAITS_MEMBER(line_number) | 30 IPC_STRUCT_TRAITS_MEMBER(line_number) | 
| 27 IPC_STRUCT_TRAITS_END() | 31 IPC_STRUCT_TRAITS_END() | 
| 28 | 32 | 
| 29 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::BirthOnThreadSnapshot) | 33 IPC_STRUCT_TRAITS_BEGIN(tracked_objects::BirthOnThreadSnapshot) | 
| (...skipping 26 matching lines...) Expand all Loading... | |
| 56 IPC_STRUCT_TRAITS_MEMBER(process_id) | 60 IPC_STRUCT_TRAITS_MEMBER(process_id) | 
| 57 IPC_STRUCT_TRAITS_END() | 61 IPC_STRUCT_TRAITS_END() | 
| 58 | 62 | 
| 59 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, | 63 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBufferType, | 
| 60 gfx::GPU_MEMORY_BUFFER_TYPE_LAST) | 64 gfx::GPU_MEMORY_BUFFER_TYPE_LAST) | 
| 61 | 65 | 
| 62 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle) | 66 IPC_STRUCT_TRAITS_BEGIN(gfx::GpuMemoryBufferHandle) | 
| 63 IPC_STRUCT_TRAITS_MEMBER(id) | 67 IPC_STRUCT_TRAITS_MEMBER(id) | 
| 64 IPC_STRUCT_TRAITS_MEMBER(type) | 68 IPC_STRUCT_TRAITS_MEMBER(type) | 
| 65 IPC_STRUCT_TRAITS_MEMBER(handle) | 69 IPC_STRUCT_TRAITS_MEMBER(handle) | 
| 66 #if defined(OS_MACOSX) | |
| 67 IPC_STRUCT_TRAITS_MEMBER(io_surface_id) | |
| 68 #endif | |
| 69 IPC_STRUCT_TRAITS_END() | 70 IPC_STRUCT_TRAITS_END() | 
| 70 | 71 | 
| 71 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBuffer::Format, | 72 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBuffer::Format, | 
| 72 gfx::GpuMemoryBuffer::FORMAT_LAST) | 73 gfx::GpuMemoryBuffer::FORMAT_LAST) | 
| 73 | 74 | 
| 74 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBuffer::Usage, | 75 IPC_ENUM_TRAITS_MAX_VALUE(gfx::GpuMemoryBuffer::Usage, | 
| 75 gfx::GpuMemoryBuffer::USAGE_LAST) | 76 gfx::GpuMemoryBuffer::USAGE_LAST) | 
| 76 | 77 | 
| 77 #undef IPC_MESSAGE_EXPORT | 78 #undef IPC_MESSAGE_EXPORT | 
| 78 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 79 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 112 | 113 | 
| 113 // Sent to child processes to tell them to enter or leave background mode. | 114 // Sent to child processes to tell them to enter or leave background mode. | 
| 114 IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetProcessBackgrounded, | 115 IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetProcessBackgrounded, | 
| 115 bool /* background */) | 116 bool /* background */) | 
| 116 | 117 | 
| 117 #if defined(USE_TCMALLOC) | 118 #if defined(USE_TCMALLOC) | 
| 118 // Sent to child process to request tcmalloc stats. | 119 // Sent to child process to request tcmalloc stats. | 
| 119 IPC_MESSAGE_CONTROL0(ChildProcessMsg_GetTcmallocStats) | 120 IPC_MESSAGE_CONTROL0(ChildProcessMsg_GetTcmallocStats) | 
| 120 #endif | 121 #endif | 
| 121 | 122 | 
| 123 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
| 124 // Sent to child processes to tell them what token to use when registering | |
| 125 // and/or acquiring IOSurfaces. | |
| 126 IPC_MESSAGE_CONTROL1(ChildProcessMsg_SetIOSurfaceManagerToken, | |
| 127 content::IOSurfaceManagerToken /* token */) | |
| 128 #endif | |
| 129 | |
| 122 //////////////////////////////////////////////////////////////////////////////// | 130 //////////////////////////////////////////////////////////////////////////////// | 
| 123 // Messages sent from the child process to the browser. | 131 // Messages sent from the child process to the browser. | 
| 124 | 132 | 
| 125 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) | 133 IPC_MESSAGE_CONTROL0(ChildProcessHostMsg_ShutdownRequest) | 
| 126 | 134 | 
| 127 // Send back profiler data (ThreadData in tracked_objects). | 135 // Send back profiler data (ThreadData in tracked_objects). | 
| 128 IPC_MESSAGE_CONTROL2( | 136 IPC_MESSAGE_CONTROL2( | 
| 129 ChildProcessHostMsg_ChildProfilerData, | 137 ChildProcessHostMsg_ChildProfilerData, | 
| 130 int, /* sequence_number */ | 138 int, /* sequence_number */ | 
| 131 tracked_objects::ProcessDataSnapshot /* process_data_snapshot */) | 139 tracked_objects::ProcessDataSnapshot /* process_data_snapshot */) | 
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 199 IPC_SYNC_MESSAGE_CONTROL2_1( | 207 IPC_SYNC_MESSAGE_CONTROL2_1( | 
| 200 ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory, | 208 ChildProcessHostMsg_SyncAllocateLockedDiscardableSharedMemory, | 
| 201 uint32 /* size */, | 209 uint32 /* size */, | 
| 202 content::DiscardableSharedMemoryId, | 210 content::DiscardableSharedMemoryId, | 
| 203 base::SharedMemoryHandle) | 211 base::SharedMemoryHandle) | 
| 204 | 212 | 
| 205 // 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 | 
| 206 // memory. | 214 // memory. | 
| 207 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_DeletedDiscardableSharedMemory, | 215 IPC_MESSAGE_CONTROL1(ChildProcessHostMsg_DeletedDiscardableSharedMemory, | 
| 208 content::DiscardableSharedMemoryId) | 216 content::DiscardableSharedMemoryId) | 
| OLD | NEW |