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

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

Issue 1134113002: content/common: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix CrOS build. 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_encode_accelerator_host.h" 5 #include "content/common/gpu/client/gpu_video_encode_accelerator_host.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/message_loop/message_loop_proxy.h"
9 #include "content/common/gpu/client/gpu_channel_host.h" 8 #include "content/common/gpu/client/gpu_channel_host.h"
10 #include "content/common/gpu/gpu_messages.h" 9 #include "content/common/gpu/gpu_messages.h"
11 #include "content/common/gpu/media/gpu_video_accelerator_util.h" 10 #include "content/common/gpu/media/gpu_video_accelerator_util.h"
12 #include "media/base/video_frame.h" 11 #include "media/base/video_frame.h"
13 12
14 namespace content { 13 namespace content {
15 14
16 #define NOTIFY_ERROR(error) \ 15 #define NOTIFY_ERROR(error) \
17 PostNotifyError(error); \ 16 PostNotifyError(error); \
18 DLOG(ERROR) 17 DLOG(ERROR)
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 impl_ = NULL; 192 impl_ = NULL;
194 193
195 // The CommandBufferProxyImpl is going away; error out this VEA. 194 // The CommandBufferProxyImpl is going away; error out this VEA.
196 OnChannelError(); 195 OnChannelError();
197 } 196 }
198 197
199 void GpuVideoEncodeAcceleratorHost::PostNotifyError(Error error) { 198 void GpuVideoEncodeAcceleratorHost::PostNotifyError(Error error) {
200 DCHECK(CalledOnValidThread()); 199 DCHECK(CalledOnValidThread());
201 DVLOG(2) << "PostNotifyError(): error=" << error; 200 DVLOG(2) << "PostNotifyError(): error=" << error;
202 // Post the error notification back to this thread, to avoid re-entrancy. 201 // Post the error notification back to this thread, to avoid re-entrancy.
203 base::MessageLoopProxy::current()->PostTask( 202 base::ThreadTaskRunnerHandle::Get()->PostTask(
204 FROM_HERE, 203 FROM_HERE, base::Bind(&GpuVideoEncodeAcceleratorHost::OnNotifyError,
205 base::Bind(&GpuVideoEncodeAcceleratorHost::OnNotifyError, 204 weak_this_factory_.GetWeakPtr(), error));
206 weak_this_factory_.GetWeakPtr(),
207 error));
208 } 205 }
209 206
210 void GpuVideoEncodeAcceleratorHost::Send(IPC::Message* message) { 207 void GpuVideoEncodeAcceleratorHost::Send(IPC::Message* message) {
211 DCHECK(CalledOnValidThread()); 208 DCHECK(CalledOnValidThread());
212 uint32 message_type = message->type(); 209 uint32 message_type = message->type();
213 if (!channel_->Send(message)) { 210 if (!channel_->Send(message)) {
214 NOTIFY_ERROR(kPlatformFailureError) << "Send(" << message_type 211 NOTIFY_ERROR(kPlatformFailureError) << "Send(" << message_type
215 << ") failed"; 212 << ") failed";
216 } 213 }
217 } 214 }
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 weak_this_factory_.InvalidateWeakPtrs(); 268 weak_this_factory_.InvalidateWeakPtrs();
272 269
273 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the 270 // Client::NotifyError() may Destroy() |this|, so calling it needs to be the
274 // last thing done on this stack! 271 // last thing done on this stack!
275 media::VideoEncodeAccelerator::Client* client = NULL; 272 media::VideoEncodeAccelerator::Client* client = NULL;
276 std::swap(client_, client); 273 std::swap(client_, client);
277 client->NotifyError(error); 274 client->NotifyError(error);
278 } 275 }
279 276
280 } // namespace content 277 } // namespace content
OLDNEW
« no previous file with comments | « content/common/gpu/client/gpu_video_decode_accelerator_host.cc ('k') | content/common/gpu/gpu_channel.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698