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

Unified Diff: chrome/browser/chromeos/drive/job_scheduler.cc

Issue 1124813003: [chrome/browser/chromeos/drive] Avoid use of MessageLoopProxy by use of TTRH (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed Review Comments 3 : Indent 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
Index: chrome/browser/chromeos/drive/job_scheduler.cc
diff --git a/chrome/browser/chromeos/drive/job_scheduler.cc b/chrome/browser/chromeos/drive/job_scheduler.cc
index 2be9669db0f09c60e6a4dd0b469594c0547e92c0..2514be328d2aadafeb861dc1b9c695d36ad0e370 100644
--- a/chrome/browser/chromeos/drive/job_scheduler.cc
+++ b/chrome/browser/chromeos/drive/job_scheduler.cc
@@ -5,12 +5,12 @@
#include "chrome/browser/chromeos/drive/job_scheduler.h"
#include "base/files/file_util.h"
-#include "base/message_loop/message_loop.h"
#include "base/metrics/histogram.h"
#include "base/prefs/pref_service.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/stringprintf.h"
+#include "base/thread_task_runner_handle.h"
#include "chrome/browser/drive/event_logger.h"
#include "chrome/common/pref_names.h"
#include "content/public/browser/browser_thread.h"
@@ -787,7 +787,7 @@ void JobScheduler::DoJobLoop(QueueType queue_type) {
// Wait when throttled.
const base::Time now = base::Time::Now();
if (now < wait_until_) {
- base::MessageLoopProxy::current()->PostDelayedTask(
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE,
base::Bind(&JobScheduler::DoJobLoop,
weak_ptr_factory_.GetWeakPtr(),
@@ -914,7 +914,8 @@ bool JobScheduler::OnJobDone(JobID job_id,
// Post a task to continue the job loop. This allows us to finish handling
// the current job before starting the next one.
- base::MessageLoopProxy::current()->PostTask(FROM_HERE,
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE,
base::Bind(&JobScheduler::DoJobLoop,
weak_ptr_factory_.GetWeakPtr(),
queue_type));
@@ -1145,8 +1146,8 @@ void JobScheduler::AbortNotRunningJob(JobEntry* job,
queue_[GetJobQueueType(job->job_info.job_type)]->Remove(job->job_info.job_id);
NotifyJobDone(job->job_info, error);
job_map_.Remove(job->job_info.job_id);
- base::MessageLoopProxy::current()->PostTask(FROM_HERE,
- base::Bind(callback, error));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(callback, error));
}
void JobScheduler::NotifyJobAdded(const JobInfo& job_info) {
« no previous file with comments | « chrome/browser/chromeos/drive/fileapi/fileapi_worker.cc ('k') | chrome/browser/chromeos/drive/job_scheduler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698