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

Unified Diff: content/common/gpu/gpu_channel_manager.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
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_channel_manager_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/gpu/gpu_channel_manager.cc
diff --git a/content/common/gpu/gpu_channel_manager.cc b/content/common/gpu/gpu_channel_manager.cc
index 4cec7cb3c8114656a0138f24c144935a56bebb1f..cb26cf21072daac96c32490d20a777aed2f8e494 100644
--- a/content/common/gpu/gpu_channel_manager.cc
+++ b/content/common/gpu/gpu_channel_manager.cc
@@ -6,9 +6,6 @@
#include "base/bind.h"
#include "base/command_line.h"
-#include "base/location.h"
-#include "base/single_thread_task_runner.h"
-#include "base/thread_task_runner_handle.h"
#include "content/common/gpu/gpu_channel.h"
#include "content/common/gpu/gpu_memory_buffer_factory.h"
#include "content/common/gpu/gpu_memory_manager.h"
@@ -88,13 +85,12 @@
} // namespace
-GpuChannelManager::GpuChannelManager(
- MessageRouter* router,
- GpuWatchdog* watchdog,
- base::SingleThreadTaskRunner* io_task_runner,
- base::WaitableEvent* shutdown_event,
- IPC::SyncChannel* channel)
- : io_task_runner_(io_task_runner),
+GpuChannelManager::GpuChannelManager(MessageRouter* router,
+ GpuWatchdog* watchdog,
+ base::MessageLoopProxy* io_message_loop,
+ base::WaitableEvent* shutdown_event,
+ IPC::SyncChannel* channel)
+ : io_message_loop_(io_message_loop),
shutdown_event_(shutdown_event),
router_(router),
gpu_memory_manager_(
@@ -110,7 +106,7 @@
relinquish_resources_pending_(false),
weak_factory_(this) {
DCHECK(router_);
- DCHECK(io_task_runner);
+ DCHECK(io_message_loop);
DCHECK(shutdown_event);
channel_->AddFilter(filter_.get());
}
@@ -210,7 +206,7 @@
client_id,
false,
allow_future_sync_points));
- channel->Init(io_task_runner_.get(), shutdown_event_);
+ channel->Init(io_message_loop_.get(), shutdown_event_);
channel_handle.name = channel->GetChannelName();
#if defined(OS_POSIX)
@@ -259,9 +255,12 @@
void GpuChannelManager::DestroyGpuMemoryBuffer(
gfx::GpuMemoryBufferId id,
int client_id) {
- io_task_runner_->PostTask(
- FROM_HERE, base::Bind(&GpuChannelManager::DestroyGpuMemoryBufferOnIO,
- base::Unretained(this), id, client_id));
+ io_message_loop_->PostTask(
+ FROM_HERE,
+ base::Bind(&GpuChannelManager::DestroyGpuMemoryBufferOnIO,
+ base::Unretained(this),
+ id,
+ client_id));
}
void GpuChannelManager::DestroyGpuMemoryBufferOnIO(
@@ -325,9 +324,10 @@
iter != gpu_channels_.end(); ++iter) {
iter->second->MarkAllContextsLost();
}
- base::ThreadTaskRunnerHandle::Get()->PostTask(
- FROM_HERE, base::Bind(&GpuChannelManager::OnLoseAllContexts,
- weak_factory_.GetWeakPtr()));
+ base::MessageLoop::current()->PostTask(
+ FROM_HERE,
+ base::Bind(&GpuChannelManager::OnLoseAllContexts,
+ weak_factory_.GetWeakPtr()));
}
void GpuChannelManager::OnLoseAllContexts() {
« no previous file with comments | « content/common/gpu/gpu_channel_manager.h ('k') | content/common/gpu/gpu_channel_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698