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

Unified Diff: components/dom_distiller/content/distillable_page_utils.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/content/distillable_page_utils.cc
diff --git a/components/dom_distiller/content/distillable_page_utils.cc b/components/dom_distiller/content/distillable_page_utils.cc
index 5d1519c7a6ee4f07ca1985baa20d156e13d750f8..7a8c2ccccd310679e3dff35ce4af58ca2eaa9eca 100644
--- a/components/dom_distiller/content/distillable_page_utils.cc
+++ b/components/dom_distiller/content/distillable_page_utils.cc
@@ -5,8 +5,10 @@
#include "components/dom_distiller/content/distillable_page_utils.h"
#include "base/bind.h"
-#include "base/message_loop/message_loop.h"
+#include "base/location.h"
+#include "base/single_thread_task_runner.h"
#include "base/strings/utf_string_conversions.h"
+#include "base/thread_task_runner_handle.h"
#include "base/values.h"
#include "components/dom_distiller/core/distillable_page_detector.h"
#include "components/dom_distiller/core/experiments.h"
@@ -37,8 +39,8 @@ void IsOpenGraphArticle(content::WebContents* web_contents,
base::Callback<void(bool)> callback) {
content::RenderFrameHost* main_frame = web_contents->GetMainFrame();
if (!main_frame) {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(callback, false));
return;
}
std::string og_article_js = ResourceBundle::GetSharedInstance()
@@ -53,8 +55,8 @@ void IsDistillablePage(content::WebContents* web_contents,
base::Callback<void(bool)> callback) {
switch (GetDistillerHeuristicsType()) {
case DistillerHeuristicsType::ALWAYS_TRUE:
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, true));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(callback, true));
return;
case DistillerHeuristicsType::OG_ARTICLE:
IsOpenGraphArticle(web_contents, callback);
@@ -62,8 +64,8 @@ void IsDistillablePage(content::WebContents* web_contents,
case DistillerHeuristicsType::ADABOOST_MODEL:
// The adaboost model is only applied to non-mobile pages.
if (is_mobile_optimized) {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, false));
return;
}
IsDistillablePageForDetector(
@@ -71,8 +73,8 @@ void IsDistillablePage(content::WebContents* web_contents,
return;
case DistillerHeuristicsType::NONE:
default:
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(
+ FROM_HERE, base::Bind(callback, false));
return;
}
}
@@ -82,8 +84,8 @@ void IsDistillablePageForDetector(content::WebContents* web_contents,
base::Callback<void(bool)> callback) {
content::RenderFrameHost* main_frame = web_contents->GetMainFrame();
if (!main_frame) {
- base::MessageLoop::current()->PostTask(FROM_HERE,
- base::Bind(callback, false));
+ base::ThreadTaskRunnerHandle::Get()->PostTask(FROM_HERE,
+ base::Bind(callback, false));
return;
}
std::string extract_features_js =

Powered by Google App Engine
This is Rietveld 408576698