Chromium Code Reviews| Index: content/common/gpu/client/gpu_video_decode_accelerator_host.h |
| diff --git a/content/common/gpu/client/gpu_video_decode_accelerator_host.h b/content/common/gpu/client/gpu_video_decode_accelerator_host.h |
| index 552813e95f89ece6e5a6acc0887a55453b9e6c8d..5a3a0ecd3b07b2c5fda19a8b4df96e9b85909e6f 100644 |
| --- a/content/common/gpu/client/gpu_video_decode_accelerator_host.h |
| +++ b/content/common/gpu/client/gpu_video_decode_accelerator_host.h |
| @@ -25,9 +25,9 @@ class GpuVideoDecodeAcceleratorHost |
| public CommandBufferProxyImpl::DeletionObserver, |
| public base::NonThreadSafe { |
| public: |
| - // |channel| is used to send IPC messages to GPU process. |
| + // Both |channel| and |impl| are guaranteed to outlive |this|. (See comments |
| + // for |channel_| and |impl_|.) |
|
Pawel Osciak
2014/03/13 06:18:13
Nit: "." after ")".
sheu
2014/03/13 22:39:52
Grammar bits :-)
If this was a parenthetical insi
|
| GpuVideoDecodeAcceleratorHost(GpuChannelHost* channel, |
| - int32 decoder_route_id, |
| CommandBufferProxyImpl* impl); |
| // IPC::Listener implementation. |
| @@ -52,8 +52,13 @@ class GpuVideoDecodeAcceleratorHost |
| // Only Destroy() should be deleting |this|. |
| virtual ~GpuVideoDecodeAcceleratorHost(); |
| + // Notify |client_| of an error. Posts a task to avoid re-entrancy. |
| + void PostNotifyError(Error); |
| + |
| void Send(IPC::Message* message); |
| + // IPC handlers, proxying media::VideoDecodeAccelerator::Client for the GPU |
| + // process. Should not be called directly. |
| void OnBitstreamBufferProcessed(int32 bitstream_buffer_id); |
| void OnProvidePictureBuffer(uint32 num_requested_buffers, |
| const gfx::Size& dimensions, |
| @@ -62,9 +67,10 @@ class GpuVideoDecodeAcceleratorHost |
| void OnPictureReady(int32 picture_buffer_id, int32 bitstream_buffer_id); |
| void OnFlushDone(); |
| void OnResetDone(); |
| - void OnErrorNotification(uint32 error); |
| + void OnNotifyError(uint32 error); |
| - // Sends IPC messages to the Gpu process. |
| + // Unowned reference to the GpuChannelHost to send IPC messages to the GPU |
| + // process. |channel_| outlives |impl_|, so |channel_| also outlives |this|. |
| GpuChannelHost* channel_; |
| // Route ID for the associated decoder in the GPU process. |
| @@ -73,12 +79,16 @@ class GpuVideoDecodeAcceleratorHost |
| // The client that will receive callbacks from the decoder. |
| Client* client_; |
| - // Unowned reference to the CommandBufferProxyImpl that created us. |
| + // Unowned reference to the CommandBufferProxyImpl that created us. |this| |
| + // registers as a DeletionObserver of |impl_|, so |impl_| outlives |this|. |
| CommandBufferProxyImpl* impl_; |
| // Requested dimensions of the buffer, from ProvidePictureBuffers(). |
| gfx::Size picture_buffer_dimensions_; |
| + // weak_ptr factory for posting tasks back to itself. |
| + base::WeakPtrFactory<GpuVideoDecodeAcceleratorHost> weak_this_factory_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(GpuVideoDecodeAcceleratorHost); |
| }; |