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 #ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 5 #ifndef CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 6 #define CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #if defined(ENABLE_GPU) | 9 #if defined(ENABLE_GPU) |
10 | 10 |
11 #include <map> | 11 #include <map> |
12 #include <queue> | 12 #include <queue> |
13 #include <string> | 13 #include <string> |
14 | 14 |
15 #include "gpu/ipc/command_buffer_proxy.h" | 15 #include "gpu/ipc/command_buffer_proxy.h" |
16 | 16 |
17 #include "base/callback.h" | 17 #include "base/callback.h" |
18 #include "base/memory/linked_ptr.h" | 18 #include "base/compiler_specific.h" |
19 #include "base/memory/scoped_ptr.h" | 19 #include "base/memory/ref_counted.h" |
20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
21 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" | 21 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" |
22 #include "gpu/command_buffer/common/command_buffer.h" | 22 #include "gpu/command_buffer/common/command_buffer.h" |
23 #include "gpu/command_buffer/common/command_buffer_shared.h" | 23 #include "gpu/command_buffer/common/command_buffer_shared.h" |
24 #include "ipc/ipc_channel.h" | 24 #include "ipc/ipc_channel.h" |
25 #include "ipc/ipc_message.h" | 25 #include "ipc/ipc_message.h" |
26 | 26 |
27 class GpuChannelHost; | 27 class GpuChannelHost; |
28 struct GPUCommandBufferConsoleMessage; | 28 struct GPUCommandBufferConsoleMessage; |
29 struct GpuMemoryAllocationForRenderer; | 29 struct GpuMemoryAllocationForRenderer; |
30 | 30 |
31 namespace base { | 31 namespace base { |
32 class SharedMemory; | 32 class SharedMemory; |
33 } | 33 } |
34 | 34 |
35 // Client side proxy that forwards messages synchronously to a | 35 // Client side proxy that forwards messages synchronously to a |
36 // CommandBufferStub. | 36 // CommandBufferStub. |
37 class CommandBufferProxyImpl : | 37 class CommandBufferProxyImpl |
38 public CommandBufferProxy, | 38 : public CommandBufferProxy, |
39 public IPC::Channel::Listener, | 39 public IPC::Channel::Listener, |
40 public base::SupportsWeakPtr<CommandBufferProxyImpl> { | 40 public base::SupportsWeakPtr<CommandBufferProxyImpl> { |
41 public: | 41 public: |
42 typedef base::Callback<void( | 42 typedef base::Callback<void( |
43 const std::string& msg, int id)> GpuConsoleMessageCallback; | 43 const std::string& msg, int id)> GpuConsoleMessageCallback; |
44 | 44 |
45 CommandBufferProxyImpl(GpuChannelHost* channel, int route_id); | 45 CommandBufferProxyImpl(GpuChannelHost* channel, int route_id); |
46 virtual ~CommandBufferProxyImpl(); | 46 virtual ~CommandBufferProxyImpl(); |
47 | 47 |
48 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and | 48 // Sends an IPC message to create a GpuVideoDecodeAccelerator. Creates and |
49 // returns a pointer to a GpuVideoDecodeAcceleratorHost. | 49 // returns a pointer to a GpuVideoDecodeAcceleratorHost. |
50 // Returns NULL on failure to create the GpuVideoDecodeAcceleratorHost. | 50 // Returns NULL on failure to create the GpuVideoDecodeAcceleratorHost. |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 memory_allocation_changed_callback_; | 152 memory_allocation_changed_callback_; |
153 | 153 |
154 GpuConsoleMessageCallback console_message_callback_; | 154 GpuConsoleMessageCallback console_message_callback_; |
155 | 155 |
156 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); | 156 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxyImpl); |
157 }; | 157 }; |
158 | 158 |
159 #endif // ENABLE_GPU | 159 #endif // ENABLE_GPU |
160 | 160 |
161 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ | 161 #endif // CONTENT_COMMON_GPU_CLIENT_COMMAND_BUFFER_PROXY_IMPL_H_ |
OLD | NEW |