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

Unified Diff: content/browser/gpu/browser_gpu_channel_host_factory.cc

Issue 1159623009: content: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test build fix. Created 5 years, 6 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/browser/geolocation/wifi_data_provider_common.cc ('k') | content/browser/histogram_synchronizer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/gpu/browser_gpu_channel_host_factory.cc
diff --git a/content/browser/gpu/browser_gpu_channel_host_factory.cc b/content/browser/gpu/browser_gpu_channel_host_factory.cc
index 4019ccb8fc7125d59ca0d12cfd9e9b961c4b142f..d14dd4c392c2f794830a8cb74a5085a93a0e358c 100644
--- a/content/browser/gpu/browser_gpu_channel_host_factory.cc
+++ b/content/browser/gpu/browser_gpu_channel_host_factory.cc
@@ -7,8 +7,11 @@
#include <set>
#include "base/bind.h"
+#include "base/location.h"
#include "base/profiler/scoped_tracker.h"
+#include "base/single_thread_task_runner.h"
#include "base/synchronization/waitable_event.h"
+#include "base/thread_task_runner_handle.h"
#include "base/threading/thread_restrictions.h"
#include "base/trace_event/trace_event.h"
#include "content/browser/gpu/browser_gpu_memory_buffer_manager.h"
@@ -123,7 +126,7 @@ class BrowserGpuChannelHostFactory::EstablishRequest
IPC::ChannelHandle channel_handle_;
gpu::GPUInfo gpu_info_;
bool finished_;
- scoped_refptr<base::MessageLoopProxy> main_loop_;
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
};
scoped_refptr<BrowserGpuChannelHostFactory::EstablishRequest>
@@ -132,10 +135,10 @@ BrowserGpuChannelHostFactory::EstablishRequest::Create(CauseForGpuLaunch cause,
int gpu_host_id) {
scoped_refptr<EstablishRequest> establish_request =
new EstablishRequest(cause, gpu_client_id, gpu_host_id);
- scoped_refptr<base::MessageLoopProxy> loop =
+ scoped_refptr<base::SingleThreadTaskRunner> task_runner =
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO);
// PostTask outside the constructor to ensure at least one reference exists.
- loop->PostTask(
+ task_runner->PostTask(
FROM_HERE,
base::Bind(&BrowserGpuChannelHostFactory::EstablishRequest::EstablishOnIO,
establish_request));
@@ -152,7 +155,7 @@ BrowserGpuChannelHostFactory::EstablishRequest::EstablishRequest(
gpu_host_id_(gpu_host_id),
reused_gpu_process_(false),
finished_(false),
- main_loop_(base::MessageLoopProxy::current()) {
+ main_task_runner_(base::ThreadTaskRunnerHandle::Get()) {
}
void BrowserGpuChannelHostFactory::EstablishRequest::EstablishOnIO() {
@@ -212,7 +215,7 @@ void BrowserGpuChannelHostFactory::EstablishRequest::OnEstablishedOnIO(
void BrowserGpuChannelHostFactory::EstablishRequest::FinishOnIO() {
event_.Signal();
- main_loop_->PostTask(
+ main_task_runner_->PostTask(
FROM_HERE,
base::Bind(&BrowserGpuChannelHostFactory::EstablishRequest::FinishOnMain,
this));
@@ -228,7 +231,7 @@ void BrowserGpuChannelHostFactory::EstablishRequest::FinishOnMain() {
}
void BrowserGpuChannelHostFactory::EstablishRequest::Wait() {
- DCHECK(main_loop_->BelongsToCurrentThread());
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
{
// TODO(vadimt): Remove ScopedTracker below once crbug.com/125248 is fixed.
tracked_objects::ScopedTracker tracking_profile(
@@ -248,7 +251,7 @@ void BrowserGpuChannelHostFactory::EstablishRequest::Wait() {
}
void BrowserGpuChannelHostFactory::EstablishRequest::Cancel() {
- DCHECK(main_loop_->BelongsToCurrentThread());
+ DCHECK(main_task_runner_->BelongsToCurrentThread());
finished_ = true;
}
« no previous file with comments | « content/browser/geolocation/wifi_data_provider_common.cc ('k') | content/browser/histogram_synchronizer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698