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

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

Issue 1135943005: Revert of content/common: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
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/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "content/common/gpu/client/gpu_channel_host.h" 10 #include "content/common/gpu/client/gpu_channel_host.h"
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 DCHECK(CalledOnValidThread()); 181 DCHECK(CalledOnValidThread());
182 impl_ = NULL; 182 impl_ = NULL;
183 183
184 // The CommandBufferProxyImpl is going away; error out this VDA. 184 // The CommandBufferProxyImpl is going away; error out this VDA.
185 OnChannelError(); 185 OnChannelError();
186 } 186 }
187 187
188 void GpuVideoDecodeAcceleratorHost::PostNotifyError(Error error) { 188 void GpuVideoDecodeAcceleratorHost::PostNotifyError(Error error) {
189 DCHECK(CalledOnValidThread()); 189 DCHECK(CalledOnValidThread());
190 DVLOG(2) << "PostNotifyError(): error=" << error; 190 DVLOG(2) << "PostNotifyError(): error=" << error;
191 base::ThreadTaskRunnerHandle::Get()->PostTask( 191 base::MessageLoopProxy::current()->PostTask(
192 FROM_HERE, base::Bind(&GpuVideoDecodeAcceleratorHost::OnNotifyError, 192 FROM_HERE,
193 weak_this_factory_.GetWeakPtr(), error)); 193 base::Bind(&GpuVideoDecodeAcceleratorHost::OnNotifyError,
194 weak_this_factory_.GetWeakPtr(),
195 error));
194 } 196 }
195 197
196 void GpuVideoDecodeAcceleratorHost::Send(IPC::Message* message) { 198 void GpuVideoDecodeAcceleratorHost::Send(IPC::Message* message) {
197 DCHECK(CalledOnValidThread()); 199 DCHECK(CalledOnValidThread());
198 uint32 message_type = message->type(); 200 uint32 message_type = message->type();
199 if (!channel_->Send(message)) { 201 if (!channel_->Send(message)) {
200 DLOG(ERROR) << "Send(" << message_type << ") failed"; 202 DLOG(ERROR) << "Send(" << message_type << ") failed";
201 PostNotifyError(PLATFORM_FAILURE); 203 PostNotifyError(PLATFORM_FAILURE);
202 } 204 }
203 } 205 }
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 weak_this_factory_.InvalidateWeakPtrs(); 262 weak_this_factory_.InvalidateWeakPtrs();
261 263
262 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 264 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
263 // last thing done on this stack! 265 // last thing done on this stack!
264 media::VideoDecodeAccelerator::Client* client = NULL; 266 media::VideoDecodeAccelerator::Client* client = NULL;
265 std::swap(client, client_); 267 std::swap(client, client_);
266 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error)); 268 client->NotifyError(static_cast<media::VideoDecodeAccelerator::Error>(error));
267 } 269 }
268 270
269 } // namespace content 271 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_channel_host.cc ('k') | content/common/gpu/client/gpu_video_encode_accelerator_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698