OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 5 #ifndef CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
6 #define CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 6 #define CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_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 | 13 |
14 #include "base/callback_old.h" | 14 #include "base/callback_old.h" |
15 #include "base/memory/linked_ptr.h" | 15 #include "base/memory/linked_ptr.h" |
16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/weak_ptr.h" |
17 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" | 18 #include "content/renderer/gpu/gpu_video_decode_accelerator_host.h" |
18 #include "gpu/command_buffer/common/command_buffer.h" | 19 #include "gpu/command_buffer/common/command_buffer.h" |
19 #include "ipc/ipc_channel.h" | 20 #include "ipc/ipc_channel.h" |
20 #include "ipc/ipc_message.h" | 21 #include "ipc/ipc_message.h" |
21 | 22 |
22 namespace base { | 23 namespace base { |
23 class SharedMemory; | 24 class SharedMemory; |
24 } | 25 } |
25 | 26 |
26 namespace gfx { | 27 namespace gfx { |
27 class Size; | 28 class Size; |
28 } | 29 } |
29 | 30 |
30 class GpuChannelHost; | 31 class GpuChannelHost; |
31 class PluginChannelHost; | 32 class PluginChannelHost; |
32 class Task; | 33 class Task; |
33 | 34 |
34 // Client side proxy that forwards messages synchronously to a | 35 // Client side proxy that forwards messages synchronously to a |
35 // CommandBufferStub. | 36 // CommandBufferStub. |
36 class CommandBufferProxy : public gpu::CommandBuffer, | 37 class CommandBufferProxy : public gpu::CommandBuffer, |
37 public IPC::Channel::Listener { | 38 public IPC::Channel::Listener, |
| 39 public base::SupportsWeakPtr<CommandBufferProxy> { |
38 public: | 40 public: |
39 CommandBufferProxy(GpuChannelHost* channel, int route_id); | 41 CommandBufferProxy(GpuChannelHost* channel, int route_id); |
40 virtual ~CommandBufferProxy(); | 42 virtual ~CommandBufferProxy(); |
41 | 43 |
42 // IPC::Channel::Listener implementation: | 44 // IPC::Channel::Listener implementation: |
43 virtual bool OnMessageReceived(const IPC::Message& message); | 45 virtual bool OnMessageReceived(const IPC::Message& message); |
44 virtual void OnChannelError(); | 46 virtual void OnChannelError(); |
45 | 47 |
46 int route_id() const { return route_id_; } | 48 int route_id() const { return route_id_; } |
47 | 49 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 | 131 |
130 scoped_ptr<Callback0::Type> swap_buffers_callback_; | 132 scoped_ptr<Callback0::Type> swap_buffers_callback_; |
131 scoped_ptr<Callback0::Type> channel_error_callback_; | 133 scoped_ptr<Callback0::Type> channel_error_callback_; |
132 | 134 |
133 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); | 135 DISALLOW_COPY_AND_ASSIGN(CommandBufferProxy); |
134 }; | 136 }; |
135 | 137 |
136 #endif // ENABLE_GPU | 138 #endif // ENABLE_GPU |
137 | 139 |
138 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ | 140 #endif // CONTENT_RENDERER_GPU_COMMAND_BUFFER_PROXY_H_ |
OLD | NEW |