diff options
Diffstat (limited to 'chrome/gpu/gpu_channel.h')
-rw-r--r-- | chrome/gpu/gpu_channel.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/gpu/gpu_channel.h b/chrome/gpu/gpu_channel.h index 1706e03..75d57ca 100644 --- a/chrome/gpu/gpu_channel.h +++ b/chrome/gpu/gpu_channel.h @@ -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 @@ class GpuChannel : public IPC::Channel::Listener, 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 + // 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. |