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

Unified Diff: content/common/gpu/media/gpu_video_decode_accelerator.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 side-by-side diff with in-line comments
Download patch
Index: content/common/gpu/media/gpu_video_decode_accelerator.cc
diff --git a/content/common/gpu/media/gpu_video_decode_accelerator.cc b/content/common/gpu/media/gpu_video_decode_accelerator.cc
index 7424d4604b7473e3cd94840f4748c795580c17e5..bcd510cca5fd1e993341a0ea9f379828e989d62c 100644
--- a/content/common/gpu/media/gpu_video_decode_accelerator.cc
+++ b/content/common/gpu/media/gpu_video_decode_accelerator.cc
@@ -8,12 +8,10 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/location.h"
#include "base/logging.h"
#include "base/memory/ref_counted.h"
-#include "base/single_thread_task_runner.h"
+#include "base/message_loop/message_loop_proxy.h"
#include "base/stl_util.h"
-#include "base/thread_task_runner_handle.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_messages.h"
@@ -129,13 +127,13 @@
GpuVideoDecodeAccelerator::GpuVideoDecodeAccelerator(
int32 host_route_id,
GpuCommandBufferStub* stub,
- const scoped_refptr<base::SingleThreadTaskRunner>& io_task_runner)
+ const scoped_refptr<base::MessageLoopProxy>& io_message_loop)
: host_route_id_(host_route_id),
stub_(stub),
texture_target_(0),
filter_removed_(true, false),
- child_task_runner_(base::ThreadTaskRunnerHandle::Get()),
- io_task_runner_(io_task_runner),
+ child_message_loop_(base::MessageLoopProxy::current()),
+ io_message_loop_(io_message_loop),
weak_factory_for_io_(this) {
DCHECK(stub_);
stub_->AddDestructionObserver(this);
@@ -207,10 +205,10 @@
// VDA may call PictureReady on IO thread. SetTextureCleared should run on
// the child thread. VDA is responsible to call PictureReady on the child
// thread when a picture buffer is delivered the first time.
- if (child_task_runner_->BelongsToCurrentThread()) {
+ if (child_message_loop_->BelongsToCurrentThread()) {
SetTextureCleared(picture);
} else {
- DCHECK(io_task_runner_->BelongsToCurrentThread());
+ DCHECK(io_message_loop_->BelongsToCurrentThread());
DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
DCHECK_EQ(0u, uncleared_textures_.count(picture.picture_buffer_id()));
}
@@ -427,10 +425,10 @@
DCHECK(video_decode_accelerator_.get());
if (id < 0) {
DLOG(ERROR) << "BitstreamBuffer id " << id << " out of range";
- if (child_task_runner_->BelongsToCurrentThread()) {
+ if (child_message_loop_->BelongsToCurrentThread()) {
NotifyError(media::VideoDecodeAccelerator::INVALID_ARGUMENT);
} else {
- child_task_runner_->PostTask(
+ child_message_loop_->PostTask(
FROM_HERE,
base::Bind(&GpuVideoDecodeAccelerator::NotifyError,
base::Unretained(this),
@@ -590,7 +588,7 @@
void GpuVideoDecodeAccelerator::SetTextureCleared(
const media::Picture& picture) {
- DCHECK(child_task_runner_->BelongsToCurrentThread());
+ DCHECK(child_message_loop_->BelongsToCurrentThread());
DebugAutoLock auto_lock(debug_uncleared_textures_lock_);
std::map<int32, scoped_refptr<gpu::gles2::TextureRef> >::iterator it;
it = uncleared_textures_.find(picture.picture_buffer_id());
@@ -607,9 +605,9 @@
}
bool GpuVideoDecodeAccelerator::Send(IPC::Message* message) {
- if (filter_.get() && io_task_runner_->BelongsToCurrentThread())
+ if (filter_.get() && io_message_loop_->BelongsToCurrentThread())
return filter_->SendOnIOThread(message);
- DCHECK(child_task_runner_->BelongsToCurrentThread());
+ DCHECK(child_message_loop_->BelongsToCurrentThread());
return stub_->channel()->Send(message);
}
« no previous file with comments | « content/common/gpu/media/gpu_video_decode_accelerator.h ('k') | content/common/gpu/media/gpu_video_encode_accelerator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698