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

Unified Diff: components/mus/common/gpu_service.cc

Issue 2087583002: Remove calls to MessageLoop::current() in components. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test error Created 4 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 | « components/mus/common/gpu_service.h ('k') | components/mus/gpu/gpu_service_mus.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/mus/common/gpu_service.cc
diff --git a/components/mus/common/gpu_service.cc b/components/mus/common/gpu_service.cc
index 833e62b339ad2cd8911f0d1d7c01166f84f9add8..0c4d3427f94158f1e5edfda8755cda57dc7d742b 100644
--- a/components/mus/common/gpu_service.cc
+++ b/components/mus/common/gpu_service.cc
@@ -6,6 +6,7 @@
#include "base/command_line.h"
#include "base/memory/singleton.h"
+#include "base/threading/thread_task_runner_handle.h"
#include "components/mus/common/gpu_type_converters.h"
#include "components/mus/common/mojo_gpu_memory_buffer_manager.h"
#include "components/mus/common/switches.h"
@@ -17,7 +18,7 @@
namespace mus {
GpuService::GpuService()
- : main_message_loop_(base::MessageLoop::current()),
+ : main_task_runner_(base::ThreadTaskRunnerHandle::Get()),
shutdown_event_(base::WaitableEvent::ResetPolicy::AUTOMATIC,
base::WaitableEvent::InitialState::NOT_SIGNALED),
io_thread_("GPUIOThread"),
@@ -78,7 +79,7 @@ scoped_refptr<gpu::GpuChannelHost> GpuService::EstablishGpuChannel(
}
bool GpuService::IsMainThread() {
- return base::MessageLoop::current() == main_message_loop_;
+ return main_task_runner_->BelongsToCurrentThread();
}
scoped_refptr<base::SingleThreadTaskRunner>
« no previous file with comments | « components/mus/common/gpu_service.h ('k') | components/mus/gpu/gpu_service_mus.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698