Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1963)

Unified Diff: content/renderer/gpu/gpu_video_decode_accelerator_host.cc

Issue 7629022: Handle client going away after GVDAH::Destroy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/gpu/gpu_video_decode_accelerator_host.cc
diff --git a/content/renderer/gpu/gpu_video_decode_accelerator_host.cc b/content/renderer/gpu/gpu_video_decode_accelerator_host.cc
index 99c94aff6056e1dabdd4b67dcfdf9d91974c2a49..69ba6334243728b90b9d0fd8d6c4a1f0448bb9ac 100644
--- a/content/renderer/gpu/gpu_video_decode_accelerator_host.cc
+++ b/content/renderer/gpu/gpu_video_decode_accelerator_host.cc
@@ -110,6 +110,7 @@ void GpuVideoDecodeAcceleratorHost::Reset() {
void GpuVideoDecodeAcceleratorHost::Destroy() {
DCHECK(CalledOnValidThread());
Send(new AcceleratedVideoDecoderMsg_Destroy(command_buffer_route_id_));
+ client_ = NULL;
}
void GpuVideoDecodeAcceleratorHost::Send(IPC::Message* message) {
@@ -125,46 +126,56 @@ void GpuVideoDecodeAcceleratorHost::Send(IPC::Message* message) {
void GpuVideoDecodeAcceleratorHost::OnBitstreamBufferProcessed(
int32 bitstream_buffer_id) {
DCHECK(CalledOnValidThread());
- client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id);
+ if (client_)
+ client_->NotifyEndOfBitstreamBuffer(bitstream_buffer_id);
}
void GpuVideoDecodeAcceleratorHost::OnProvidePictureBuffer(
uint32 num_requested_buffers,
const gfx::Size& buffer_size) {
DCHECK(CalledOnValidThread());
- client_->ProvidePictureBuffers(num_requested_buffers, buffer_size);
+ if (client_)
+ client_->ProvidePictureBuffers(num_requested_buffers, buffer_size);
}
void GpuVideoDecodeAcceleratorHost::OnDismissPictureBuffer(
int32 picture_buffer_id) {
DCHECK(CalledOnValidThread());
- client_->DismissPictureBuffer(picture_buffer_id);
+ if (client_)
+ client_->DismissPictureBuffer(picture_buffer_id);
}
void GpuVideoDecodeAcceleratorHost::OnPictureReady(
int32 picture_buffer_id, int32 bitstream_buffer_id) {
DCHECK(CalledOnValidThread());
+ if (!client_)
+ return;
media::Picture picture(picture_buffer_id, bitstream_buffer_id);
client_->PictureReady(picture);
}
void GpuVideoDecodeAcceleratorHost::OnFlushDone() {
DCHECK(CalledOnValidThread());
- client_->NotifyFlushDone();
+ if (client_)
+ client_->NotifyFlushDone();
}
void GpuVideoDecodeAcceleratorHost::OnResetDone() {
DCHECK(CalledOnValidThread());
- client_->NotifyResetDone();
+ if (client_)
+ client_->NotifyResetDone();
}
void GpuVideoDecodeAcceleratorHost::OnEndOfStream() {
DCHECK(CalledOnValidThread());
- client_->NotifyEndOfStream();
+ if (client_)
+ client_->NotifyEndOfStream();
}
void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) {
DCHECK(CalledOnValidThread());
+ if (!client_)
+ return;
client_->NotifyError(
static_cast<media::VideoDecodeAccelerator::Error>(error));
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698