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

Side by Side Diff: content/common/gpu/client/gpu_video_decode_accelerator_host.cc

Issue 10829082: Don't try to read message->type() after message has been deleted. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h" 5 #include "content/common/gpu/client/gpu_video_decode_accelerator_host.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "content/common/gpu/client/gpu_channel_host.h" 10 #include "content/common/gpu/client/gpu_channel_host.h"
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 delete this; 125 delete this;
126 } 126 }
127 127
128 GpuVideoDecodeAcceleratorHost::~GpuVideoDecodeAcceleratorHost() {} 128 GpuVideoDecodeAcceleratorHost::~GpuVideoDecodeAcceleratorHost() {}
129 129
130 void GpuVideoDecodeAcceleratorHost::Send(IPC::Message* message) { 130 void GpuVideoDecodeAcceleratorHost::Send(IPC::Message* message) {
131 // After OnChannelError is called, the client should no longer send 131 // After OnChannelError is called, the client should no longer send
132 // messages to the gpu channel through this object. But queued posted tasks 132 // messages to the gpu channel through this object. But queued posted tasks
133 // can still be draining, so we're forgiving and simply ignore them. 133 // can still be draining, so we're forgiving and simply ignore them.
134 bool error = false; 134 bool error = false;
135 uint32 message_type = message->type();
135 if (!channel_) { 136 if (!channel_) {
136 delete message; 137 delete message;
137 DLOG(ERROR) << "Send(" << message->type() << ") after error ignored"; 138 DLOG(ERROR) << "Send(" << message_type << ") after error ignored";
138 error = true; 139 error = true;
139 } else if (!channel_->Send(message)) { 140 } else if (!channel_->Send(message)) {
140 DLOG(ERROR) << "Send(" << message->type() << ") failed"; 141 DLOG(ERROR) << "Send(" << message_type << ") failed";
141 error = true; 142 error = true;
142 } 143 }
143 if (error) 144 if (error)
144 OnErrorNotification(PLATFORM_FAILURE); 145 OnErrorNotification(PLATFORM_FAILURE);
145 } 146 }
146 147
147 void GpuVideoDecodeAcceleratorHost::OnBitstreamBufferProcessed( 148 void GpuVideoDecodeAcceleratorHost::OnBitstreamBufferProcessed(
148 int32 bitstream_buffer_id) { 149 int32 bitstream_buffer_id) {
149 DCHECK(CalledOnValidThread()); 150 DCHECK(CalledOnValidThread());
150 if (client_) 151 if (client_)
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 } 192 }
192 193
193 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) { 194 void GpuVideoDecodeAcceleratorHost::OnErrorNotification(uint32 error) {
194 DCHECK(CalledOnValidThread()); 195 DCHECK(CalledOnValidThread());
195 if (!client_) 196 if (!client_)
196 return; 197 return;
197 client_->NotifyError( 198 client_->NotifyError(
198 static_cast<media::VideoDecodeAccelerator::Error>(error)); 199 static_cast<media::VideoDecodeAccelerator::Error>(error));
199 client_ = NULL; 200 client_ = NULL;
200 } 201 }
OLDNEW
« 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