Commit bb23fc7a authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in /components/dom_distiller

These changes were scripted as part of the effort to restrict exposure of the
raw MessageLoop*.

Note that many static methods exposed on MessageLoopCurrent are also deprecated
so it is very well possible that this is migrating to an already deprecated
method.

The goal of this pass is to reduce usage of MessageLoop::current() (and
ultimately make it impossible to obtain the MessageLoop* statically).

As such I will not edit this CL unless the script did something logically wrong.
I defer to owners to fix highlighted usage of already deprecated APIs.

Possible script screw ups / things to look out for in this review:
 - Storing MessageLoopCurrent in a MessageLoop* variable or comparing it against
   one (I will go over that in a separate pass).

Includes should have been stripped if that was the last usage of message_loop.h
in that file.

Please CQ if LGTY

This CL was uploaded by git cl split.

TBR=wychen@chromium.org

Bug: 825327
Change-Id: I54dafd02e4631007e7ea15efff66e91f68063a3b
Reviewed-on: https://chromium-review.googlesource.com/1024656Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553656}
parent 32870324
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "base/location.h" #include "base/location.h"
#include "base/macros.h" #include "base/macros.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_current.h"
#include "base/run_loop.h" #include "base/run_loop.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
...@@ -241,7 +242,7 @@ class TestDistillerURLFetcher : public DistillerURLFetcher { ...@@ -241,7 +242,7 @@ class TestDistillerURLFetcher : public DistillerURLFetcher {
} }
void PostCallbackTask() { void PostCallbackTask() {
ASSERT_TRUE(base::MessageLoop::current()); ASSERT_TRUE(base::MessageLoopCurrent::Get());
ASSERT_FALSE(callback_.is_null()); ASSERT_FALSE(callback_.is_null());
base::ThreadTaskRunnerHandle::Get()->PostTask( base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::Bind(callback_, responses_[url_])); FROM_HERE, base::Bind(callback_, responses_[url_]));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment