| 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 // Multiply-included message file, hence no include guard here, but see below | 5 // Multiply-included message file, hence no include guard here, but see below |
| 6 // for a much smaller-than-usual include guard section. | 6 // for a much smaller-than-usual include guard section. |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/shared_memory.h" | 11 #include "base/shared_memory.h" |
| 12 #include "content/common/content_export.h" | 12 #include "content/common/content_export.h" |
| 13 #include "content/common/gpu/gpu_memory_allocation.h" | 13 #include "content/common/gpu/gpu_memory_allocation.h" |
| 14 #include "content/common/gpu/gpu_memory_uma_stats.h" | 14 #include "content/common/gpu/gpu_memory_uma_stats.h" |
| 15 #include "content/common/gpu/gpu_process_launch_causes.h" | 15 #include "content/common/gpu/gpu_process_launch_causes.h" |
| 16 #include "content/common/gpu/gpu_rendering_stats.h" | 16 #include "content/common/gpu/gpu_rendering_stats.h" |
| 17 #include "content/public/common/common_param_traits.h" | 17 #include "content/public/common/common_param_traits.h" |
| 18 #include "content/public/common/gpu_info.h" | 18 #include "content/public/common/gpu_info.h" |
| 19 #include "content/public/common/gpu_memory_stats.h" | 19 #include "content/public/common/gpu_memory_stats.h" |
| 20 #include "gpu/command_buffer/common/command_buffer.h" | 20 #include "gpu/command_buffer/common/command_buffer.h" |
| 21 #include "gpu/command_buffer/common/constants.h" | 21 #include "gpu/command_buffer/common/constants.h" |
| 22 #include "gpu/ipc/gpu_command_buffer_traits.h" | 22 #include "gpu/ipc/gpu_command_buffer_traits.h" |
| 23 #include "ipc/ipc_channel_handle.h" | 23 #include "ipc/ipc_channel_handle.h" |
| 24 #include "ipc/ipc_message_macros.h" | 24 #include "ipc/ipc_message_macros.h" |
| 25 #include "media/video/video_decode_accelerator.h" | 25 #include "media/video/video_decode_accelerator.h" |
| 26 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 27 #include "ui/gfx/size.h" | 27 #include "ui/gfx/size.h" |
| 28 #include "ui/gl/gpu_preference.h" | 28 #include "ui/gl/gpu_preference.h" |
| 29 #include "ui/surface/transport_dib.h" | 29 #include "ui/surface/transport_dib.h" |
| 30 #include "webkit/compositor_bindings/web_latency_info_impl.h" |
| 30 | 31 |
| 31 #if defined(OS_ANDROID) | 32 #if defined(OS_ANDROID) |
| 32 #include "content/common/android/surface_texture_peer.h" | 33 #include "content/common/android/surface_texture_peer.h" |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 #define IPC_MESSAGE_START GpuMsgStart | 36 #define IPC_MESSAGE_START GpuMsgStart |
| 36 | 37 |
| 37 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) | 38 IPC_STRUCT_BEGIN(GPUCreateCommandBufferConfig) |
| 38 IPC_STRUCT_MEMBER(int32, share_group_id) | 39 IPC_STRUCT_MEMBER(int32, share_group_id) |
| 39 IPC_STRUCT_MEMBER(std::string, allowed_extensions) | 40 IPC_STRUCT_MEMBER(std::string, allowed_extensions) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 52 #undef IPC_MESSAGE_EXPORT | 53 #undef IPC_MESSAGE_EXPORT |
| 53 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT | 54 #define IPC_MESSAGE_EXPORT CONTENT_EXPORT |
| 54 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) | 55 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceBuffersSwapped_Params) |
| 55 IPC_STRUCT_MEMBER(int32, surface_id) | 56 IPC_STRUCT_MEMBER(int32, surface_id) |
| 56 IPC_STRUCT_MEMBER(uint64, surface_handle) | 57 IPC_STRUCT_MEMBER(uint64, surface_handle) |
| 57 IPC_STRUCT_MEMBER(int32, route_id) | 58 IPC_STRUCT_MEMBER(int32, route_id) |
| 58 IPC_STRUCT_MEMBER(gfx::Size, size) | 59 IPC_STRUCT_MEMBER(gfx::Size, size) |
| 59 #if defined(OS_MACOSX) | 60 #if defined(OS_MACOSX) |
| 60 IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window) | 61 IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window) |
| 61 #endif | 62 #endif |
| 63 IPC_STRUCT_MEMBER(WebKit::WebLatencyInfoImpl, latency_info) |
| 62 IPC_STRUCT_END() | 64 IPC_STRUCT_END() |
| 63 #undef IPC_MESSAGE_EXPORT | 65 #undef IPC_MESSAGE_EXPORT |
| 64 #define IPC_MESSAGE_EXPORT | 66 #define IPC_MESSAGE_EXPORT |
| 65 | 67 |
| 66 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) | 68 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfacePostSubBuffer_Params) |
| 67 IPC_STRUCT_MEMBER(int32, surface_id) | 69 IPC_STRUCT_MEMBER(int32, surface_id) |
| 68 IPC_STRUCT_MEMBER(uint64, surface_handle) | 70 IPC_STRUCT_MEMBER(uint64, surface_handle) |
| 69 IPC_STRUCT_MEMBER(int32, route_id) | 71 IPC_STRUCT_MEMBER(int32, route_id) |
| 70 IPC_STRUCT_MEMBER(int, x) | 72 IPC_STRUCT_MEMBER(int, x) |
| 71 IPC_STRUCT_MEMBER(int, y) | 73 IPC_STRUCT_MEMBER(int, y) |
| 72 IPC_STRUCT_MEMBER(int, width) | 74 IPC_STRUCT_MEMBER(int, width) |
| 73 IPC_STRUCT_MEMBER(int, height) | 75 IPC_STRUCT_MEMBER(int, height) |
| 74 IPC_STRUCT_MEMBER(gfx::Size, surface_size) | 76 IPC_STRUCT_MEMBER(gfx::Size, surface_size) |
| 75 #if defined(OS_MACOSX) | 77 #if defined(OS_MACOSX) |
| 76 IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window) | 78 IPC_STRUCT_MEMBER(gfx::PluginWindowHandle, window) |
| 77 #endif | 79 #endif |
| 80 IPC_STRUCT_MEMBER(WebKit::WebLatencyInfoImpl, latency_info) |
| 78 IPC_STRUCT_END() | 81 IPC_STRUCT_END() |
| 79 | 82 |
| 80 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params) | 83 IPC_STRUCT_BEGIN(GpuHostMsg_AcceleratedSurfaceRelease_Params) |
| 81 IPC_STRUCT_MEMBER(int32, surface_id) | 84 IPC_STRUCT_MEMBER(int32, surface_id) |
| 82 IPC_STRUCT_MEMBER(int32, route_id) | 85 IPC_STRUCT_MEMBER(int32, route_id) |
| 83 IPC_STRUCT_END() | 86 IPC_STRUCT_END() |
| 84 | 87 |
| 85 IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage) | 88 IPC_STRUCT_BEGIN(GPUCommandBufferConsoleMessage) |
| 86 IPC_STRUCT_MEMBER(int32, id) | 89 IPC_STRUCT_MEMBER(int32, id) |
| 87 IPC_STRUCT_MEMBER(std::string, message) | 90 IPC_STRUCT_MEMBER(std::string, message) |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 IPC_MESSAGE_ROUTED0(AcceleratedSurfaceMsg_ResizeViewACK) | 276 IPC_MESSAGE_ROUTED0(AcceleratedSurfaceMsg_ResizeViewACK) |
| 274 | 277 |
| 275 // Tells the GPU process that the browser process has handled the swap | 278 // Tells the GPU process that the browser process has handled the swap |
| 276 // buffers or post sub-buffer request. A non-zero sync point means | 279 // buffers or post sub-buffer request. A non-zero sync point means |
| 277 // that we should wait for the sync point. The surface_handle identifies | 280 // that we should wait for the sync point. The surface_handle identifies |
| 278 // that buffer that has finished presented, i.e. the buffer being returned. | 281 // that buffer that has finished presented, i.e. the buffer being returned. |
| 279 IPC_MESSAGE_ROUTED2(AcceleratedSurfaceMsg_BufferPresented, | 282 IPC_MESSAGE_ROUTED2(AcceleratedSurfaceMsg_BufferPresented, |
| 280 uint64 /* surface_handle */, | 283 uint64 /* surface_handle */, |
| 281 uint32 /* sync_point */) | 284 uint32 /* sync_point */) |
| 282 | 285 |
| 286 // Tells the GPU process that the browser process has handled the swap |
| 287 // buffers or post sub-buffer request. A non-zero sync point means |
| 288 // that we should wait for the sync point. |
| 289 IPC_MESSAGE_ROUTED1(AcceleratedSurfaceMsg_FrameDisplayed, |
| 290 WebKit::WebLatencyInfoImpl /* latency_info */) |
| 291 |
| 283 // Tells the GPU process to remove all contexts. | 292 // Tells the GPU process to remove all contexts. |
| 284 IPC_MESSAGE_CONTROL0(GpuMsg_Clean) | 293 IPC_MESSAGE_CONTROL0(GpuMsg_Clean) |
| 285 | 294 |
| 286 // Tells the GPU process to crash. | 295 // Tells the GPU process to crash. |
| 287 IPC_MESSAGE_CONTROL0(GpuMsg_Crash) | 296 IPC_MESSAGE_CONTROL0(GpuMsg_Crash) |
| 288 | 297 |
| 289 // Tells the GPU process to hang. | 298 // Tells the GPU process to hang. |
| 290 IPC_MESSAGE_CONTROL0(GpuMsg_Hang) | 299 IPC_MESSAGE_CONTROL0(GpuMsg_Hang) |
| 291 | 300 |
| 292 // Tells the GPU process to disable the watchdog thread. | 301 // Tells the GPU process to disable the watchdog thread. |
| (...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 501 IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetStateFast, | 510 IPC_SYNC_MESSAGE_ROUTED0_1(GpuCommandBufferMsg_GetStateFast, |
| 502 gpu::CommandBuffer::State /* state */) | 511 gpu::CommandBuffer::State /* state */) |
| 503 | 512 |
| 504 // Asynchronously synchronize the put and get offsets of both processes. | 513 // Asynchronously synchronize the put and get offsets of both processes. |
| 505 // Caller passes its current put offset. Current state (including get offset) | 514 // Caller passes its current put offset. Current state (including get offset) |
| 506 // is returned in shared memory. | 515 // is returned in shared memory. |
| 507 IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush, | 516 IPC_MESSAGE_ROUTED2(GpuCommandBufferMsg_AsyncFlush, |
| 508 int32 /* put_offset */, | 517 int32 /* put_offset */, |
| 509 uint32 /* flush_count */) | 518 uint32 /* flush_count */) |
| 510 | 519 |
| 520 // Sends information about the latency of the current frame to or from the GPU |
| 521 // process. |
| 522 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_SetLatencyInfo, |
| 523 WebKit::WebLatencyInfoImpl /* latency_info */) |
| 524 |
| 511 // Asynchronously process any commands known to the GPU process. This is only | 525 // Asynchronously process any commands known to the GPU process. This is only |
| 512 // used in the event that a channel is unscheduled and needs to be flushed | 526 // used in the event that a channel is unscheduled and needs to be flushed |
| 513 // again to process any commands issued subsequent to unscheduling. The GPU | 527 // again to process any commands issued subsequent to unscheduling. The GPU |
| 514 // process actually sends it (deferred) to itself. | 528 // process actually sends it (deferred) to itself. |
| 515 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_Rescheduled) | 529 IPC_MESSAGE_ROUTED0(GpuCommandBufferMsg_Rescheduled) |
| 516 | 530 |
| 517 // Sent by the GPU process to display messages in the console. | 531 // Sent by the GPU process to display messages in the console. |
| 518 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ConsoleMsg, | 532 IPC_MESSAGE_ROUTED1(GpuCommandBufferMsg_ConsoleMsg, |
| 519 GPUCommandBufferConsoleMessage /* msg */) | 533 GPUCommandBufferConsoleMessage /* msg */) |
| 520 | 534 |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 693 | 707 |
| 694 // Confirm decoder has been flushed. | 708 // Confirm decoder has been flushed. |
| 695 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) | 709 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_FlushDone) |
| 696 | 710 |
| 697 // Confirm decoder has been reset. | 711 // Confirm decoder has been reset. |
| 698 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) | 712 IPC_MESSAGE_ROUTED0(AcceleratedVideoDecoderHostMsg_ResetDone) |
| 699 | 713 |
| 700 // Video decoder has encountered an error. | 714 // Video decoder has encountered an error. |
| 701 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, | 715 IPC_MESSAGE_ROUTED1(AcceleratedVideoDecoderHostMsg_ErrorNotification, |
| 702 uint32) /* Error ID */ | 716 uint32) /* Error ID */ |
| OLD | NEW |