Chromium Code Reviews| Index: chrome/gpu/gpu_channel.h |
| =================================================================== |
| --- chrome/gpu/gpu_channel.h (revision 71128) |
| +++ chrome/gpu/gpu_channel.h (working copy) |
| @@ -24,17 +24,23 @@ |
| #include "ipc/ipc_message.h" |
| #include "ipc/ipc_sync_channel.h" |
| +class GpuThread; |
| + |
| // Encapsulates an IPC channel between the GPU process and one renderer |
| // process. On the renderer side there's a corresponding GpuChannelHost. |
| class GpuChannel : public IPC::Channel::Listener, |
| public IPC::Message::Sender, |
| public base::RefCountedThreadSafe<GpuChannel> { |
| public: |
| - explicit GpuChannel(int renderer_id); |
| + GpuChannel(GpuThread* gpu_thread, int renderer_id); |
| virtual ~GpuChannel(); |
| bool Init(); |
| + // Get the GpuThread that owns this channel. |
| + GpuThread* gpu_thread() const { return gpu_thread_; } |
| + |
| + // Returns the name of the associated IPC channel. |
| std::string GetChannelName(); |
| #if defined(OS_POSIX) |
| @@ -84,6 +90,11 @@ |
| int32 decoder_host_id); |
| void OnDestroyVideoDecoder(int32 decoder_id); |
| + // The lifetime of objects of this class is managed by a GpuThread. The |
| + // GpuThreadss destroy all the GpuChannels that they own when they |
|
Ken Russell (switch to Gerrit)
2011/01/12 23:13:56
GpuThreadss -> GpuThreads
|
| + // are destroyed. So a raw pointer is safe. |
| + GpuThread* gpu_thread_; |
| + |
| scoped_ptr<IPC::SyncChannel> channel_; |
| // Handle to the renderer process who is on the other side of the channel. |