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 = |