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

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

Issue 1167163002: chrome: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added some missing message_loop.h includes. 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
Index: chrome/service/cloud_print/cloud_print_connector.cc
diff --git a/chrome/service/cloud_print/cloud_print_connector.cc b/chrome/service/cloud_print/cloud_print_connector.cc
index 4abc4b4bf8562702093b951c458d7ee3190e909d..fa7839231b19db44a286b1f592d9788ca97d13aa 100644
--- a/chrome/service/cloud_print/cloud_print_connector.cc
+++ b/chrome/service/cloud_print/cloud_print_connector.cc
@@ -6,13 +6,16 @@
#include "base/bind.h"
#include "base/bind_helpers.h"
+#include "base/location.h"
#include "base/md5.h"
#include "base/rand_util.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "base/values.h"
#include "chrome/common/cloud_print/cloud_print_constants.h"
#include "chrome/common/cloud_print/cloud_print_helpers.h"
@@ -51,10 +54,9 @@ bool CloudPrintConnector::InitPrintSystem() {
}
void CloudPrintConnector::ScheduleStatsReport() {
- base::MessageLoop::current()->PostDelayedTask(
- FROM_HERE,
- base::Bind(&CloudPrintConnector::ReportStats,
- stats_ptr_factory_.GetWeakPtr()),
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, base::Bind(&CloudPrintConnector::ReportStats,
+ stats_ptr_factory_.GetWeakPtr()),
base::TimeDelta::FromHours(1));
}
@@ -492,7 +494,7 @@ void CloudPrintConnector::AddPendingTask(const PendingTask& task) {
pending_tasks_.push_back(task);
// If this is the only pending task, we need to start the process.
if (pending_tasks_.size() == 1) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&CloudPrintConnector::ProcessPendingTask, this));
}
}
@@ -527,7 +529,7 @@ void CloudPrintConnector::ContinuePendingTaskProcessing() {
// Delete current task and repost if we have more task available.
pending_tasks_.pop_front();
if (pending_tasks_.size() != 0) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(&CloudPrintConnector::ProcessPendingTask, this));
}
}
« no previous file with comments | « chrome/service/cloud_print/cloud_print_auth.cc ('k') | chrome/service/cloud_print/cloud_print_proxy_backend.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698