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_COMMON_GPU_GPU_CHANNEL_H_ | 5 #ifndef CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 6 #define CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/id_map.h" | 13 #include "base/id_map.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/process.h" | 15 #include "base/process.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
17 #include "content/common/gpu/gpu_command_buffer_stub.h" | 17 #include "content/common/gpu/gpu_command_buffer_stub.h" |
18 #include "content/common/message_router.h" | 18 #include "content/common/message_router.h" |
19 #include "ipc/ipc_sync_channel.h" | 19 #include "ipc/ipc_sync_channel.h" |
20 #include "ui/gfx/native_widget_types.h" | 20 #include "ui/gfx/native_widget_types.h" |
21 #include "ui/gfx/size.h" | 21 #include "ui/gfx/size.h" |
22 | 22 |
23 class GpuChannelManager; | 23 class GpuChannelManager; |
24 struct GPUCreateCommandBufferConfig; | 24 struct GPUCreateCommandBufferConfig; |
25 class GpuWatchdog; | 25 class GpuWatchdog; |
26 class MessageLoop; | |
27 class TransportTexture; | 26 class TransportTexture; |
28 | 27 |
29 namespace base { | 28 namespace base { |
| 29 class MessageLoopProxy; |
30 class WaitableEvent; | 30 class WaitableEvent; |
31 } | 31 } |
32 | 32 |
33 // Encapsulates an IPC channel between the GPU process and one renderer | 33 // Encapsulates an IPC channel between the GPU process and one renderer |
34 // process. On the renderer side there's a corresponding GpuChannelHost. | 34 // process. On the renderer side there's a corresponding GpuChannelHost. |
35 class GpuChannel : public IPC::Channel::Listener, | 35 class GpuChannel : public IPC::Channel::Listener, |
36 public IPC::Message::Sender, | 36 public IPC::Message::Sender, |
37 public base::RefCountedThreadSafe<GpuChannel> { | 37 public base::RefCountedThreadSafe<GpuChannel> { |
38 public: | 38 public: |
39 // Takes ownership of the renderer process handle. | 39 // Takes ownership of the renderer process handle. |
40 GpuChannel(GpuChannelManager* gpu_channel_manager, | 40 GpuChannel(GpuChannelManager* gpu_channel_manager, |
41 GpuWatchdog* watchdog, | 41 GpuWatchdog* watchdog, |
42 int renderer_id); | 42 int renderer_id); |
43 virtual ~GpuChannel(); | 43 virtual ~GpuChannel(); |
44 | 44 |
45 bool Init(MessageLoop* io_message_loop, base::WaitableEvent* shutdown_event); | 45 bool Init(base::MessageLoopProxy* io_message_loop, |
| 46 base::WaitableEvent* shutdown_event); |
46 | 47 |
47 // Get the GpuChannelManager that owns this channel. | 48 // Get the GpuChannelManager that owns this channel. |
48 GpuChannelManager* gpu_channel_manager() const { | 49 GpuChannelManager* gpu_channel_manager() const { |
49 return gpu_channel_manager_; | 50 return gpu_channel_manager_; |
50 } | 51 } |
51 | 52 |
52 // Returns the name of the associated IPC channel. | 53 // Returns the name of the associated IPC channel. |
53 std::string GetChannelName(); | 54 std::string GetChannelName(); |
54 | 55 |
55 #if defined(OS_POSIX) | 56 #if defined(OS_POSIX) |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 TransportTextureMap transport_textures_; | 147 TransportTextureMap transport_textures_; |
147 | 148 |
148 bool log_messages_; // True if we should log sent and received messages. | 149 bool log_messages_; // True if we should log sent and received messages. |
149 gpu::gles2::DisallowedExtensions disallowed_extensions_; | 150 gpu::gles2::DisallowedExtensions disallowed_extensions_; |
150 GpuWatchdog* watchdog_; | 151 GpuWatchdog* watchdog_; |
151 | 152 |
152 DISALLOW_COPY_AND_ASSIGN(GpuChannel); | 153 DISALLOW_COPY_AND_ASSIGN(GpuChannel); |
153 }; | 154 }; |
154 | 155 |
155 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ | 156 #endif // CONTENT_COMMON_GPU_GPU_CHANNEL_H_ |
OLD | NEW |