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

Unified Diff: components/dom_distiller/core/task_tracker.cc

Issue 1144153004: components: Remove use of MessageLoopProxy and deprecated MessageLoop APIs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. 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: components/dom_distiller/core/task_tracker.cc
diff --git a/components/dom_distiller/core/task_tracker.cc b/components/dom_distiller/core/task_tracker.cc
index d9eb43afbef0e3266fc481b244078d47daf89fc2..faeb22a36a28e2688e2f0232d0a92e71f8b998c8 100644
--- a/components/dom_distiller/core/task_tracker.cc
+++ b/components/dom_distiller/core/task_tracker.cc
@@ -5,7 +5,9 @@
#include "components/dom_distiller/core/task_tracker.h"
#include "base/auto_reset.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
+#include "base/thread_task_runner_handle.h"
#include "components/dom_distiller/core/distilled_content_store.h"
#include "components/dom_distiller/core/proto/distilled_article.pb.h"
#include "components/dom_distiller/core/proto/distilled_page.pb.h"
@@ -82,11 +84,9 @@ scoped_ptr<ViewerHandle> TaskTracker::AddViewer(ViewRequestDelegate* delegate) {
if (content_ready_) {
// Distillation for this task has already completed, and so the delegate can
// be immediately told of the result.
- base::MessageLoop::current()->PostTask(
- FROM_HERE,
- base::Bind(&TaskTracker::NotifyViewer,
- weak_ptr_factory_.GetWeakPtr(),
- delegate));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(&TaskTracker::NotifyViewer,
+ weak_ptr_factory_.GetWeakPtr(), delegate));
}
return scoped_ptr<ViewerHandle>(new ViewerHandle(base::Bind(
&TaskTracker::RemoveViewer, weak_ptr_factory_.GetWeakPtr(), delegate)));
@@ -130,10 +130,9 @@ void TaskTracker::MaybeCancel() {
void TaskTracker::CancelSaveCallbacks() { ScheduleSaveCallbacks(false); }
void TaskTracker::ScheduleSaveCallbacks(bool distillation_succeeded) {
- base::MessageLoop::current()->PostTask(
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
- base::Bind(&TaskTracker::DoSaveCallbacks,
- weak_ptr_factory_.GetWeakPtr(),
+ base::Bind(&TaskTracker::DoSaveCallbacks, weak_ptr_factory_.GetWeakPtr(),
distillation_succeeded));
}
« no previous file with comments | « components/dom_distiller/core/fake_distiller.cc ('k') | components/dom_distiller/standalone/content_extractor_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698