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

Unified Diff: chrome/service/cloud_print/cloud_print_proxy_backend.cc

Issue 2110603002: Remove calls to MessageLoop::current() in chrome. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/service/cloud_print/cloud_print_proxy_backend.cc
diff --git a/chrome/service/cloud_print/cloud_print_proxy_backend.cc b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
index bb1d87cf902720b17bb61836ea20e2ebd02e4a9b..1e86d7c8b2a9c431636949c8f214486c87cb49ae 100644
--- a/chrome/service/cloud_print/cloud_print_proxy_backend.cc
+++ b/chrome/service/cloud_print/cloud_print_proxy_backend.cc
@@ -16,7 +16,6 @@
#include "base/macros.h"
#include "base/metrics/histogram.h"
#include "base/rand_util.h"
-#include "base/single_thread_task_runner.h"
#include "base/strings/string_util.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
@@ -173,7 +172,7 @@ CloudPrintProxyBackend::CloudPrintProxyBackend(
const gaia::OAuthClientInfo& oauth_client_info,
bool enable_job_poll)
: core_thread_("Chrome_CloudPrintProxyCoreThread"),
- frontend_loop_(base::MessageLoop::current()),
+ frontend_task_runner_(base::ThreadTaskRunnerHandle::Get()),
frontend_(frontend) {
DCHECK(frontend_);
core_ = new Core(this, settings, oauth_client_info, enable_job_poll);
@@ -252,15 +251,15 @@ CloudPrintProxyBackend::Core::Core(
bool CloudPrintProxyBackend::Core::PostFrontendTask(
const tracked_objects::Location& from_here,
const base::Closure& task) {
- return backend_->frontend_loop_->task_runner()->PostTask(from_here, task);
+ return backend_->frontend_task_runner_->PostTask(from_here, task);
}
bool CloudPrintProxyBackend::Core::CurrentlyOnFrontendThread() const {
- return base::MessageLoop::current() == backend_->frontend_loop_;
+ return backend_->frontend_task_runner_->BelongsToCurrentThread();
}
bool CloudPrintProxyBackend::Core::CurrentlyOnCoreThread() const {
- return base::MessageLoop::current() == backend_->core_thread_.message_loop();
+ return backend_->core_thread_.task_runner()->BelongsToCurrentThread();
}
void CloudPrintProxyBackend::Core::CreateAuthAndConnector() {
« no previous file with comments | « chrome/service/cloud_print/cloud_print_proxy_backend.h ('k') | chrome/service/cloud_print/printer_job_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698