Commit 2b94633e authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in /chrome/browser/extensions/activity_log

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.

R=rdevlin.cronin@chromium.org

Bug: 825327
Change-Id: I0fba6092e86514d3744298ecced1a82327be5181
Reviewed-on: https://chromium-review.googlesource.com/1024407
Commit-Queue: Gabriel Charette <gab@chromium.org>
Commit-Queue: Devlin <rdevlin.cronin@chromium.org>
Reviewed-by: default avatarDevlin <rdevlin.cronin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#552802}
parent a2e128e2
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include "base/cancelable_callback.h" #include "base/cancelable_callback.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/location.h" #include "base/location.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_split.h" #include "base/strings/string_split.h"
...@@ -106,7 +106,7 @@ class CountingPolicyTest : public testing::Test { ...@@ -106,7 +106,7 @@ class CountingPolicyTest : public testing::Test {
policy->ReadFilteredData( policy->ReadFilteredData(
extension_id, type, api_name, page_url, arg_url, day, extension_id, type, api_name, page_url, arg_url, day,
base::BindOnce(&CountingPolicyTest::CheckWrapper, std::move(checker), base::BindOnce(&CountingPolicyTest::CheckWrapper, std::move(checker),
base::MessageLoop::current()->QuitWhenIdleClosure())); base::MessageLoopCurrent::Get()->QuitWhenIdleClosure()));
// Set up a timeout for receiving results; if we haven't received anything // Set up a timeout for receiving results; if we haven't received anything
// when the timeout triggers then assume that the test is broken. // when the timeout triggers then assume that the test is broken.
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "base/cancelable_callback.h" #include "base/cancelable_callback.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/location.h" #include "base/location.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/stringprintf.h" #include "base/strings/stringprintf.h"
...@@ -97,7 +97,7 @@ class FullStreamUIPolicyTest : public testing::Test { ...@@ -97,7 +97,7 @@ class FullStreamUIPolicyTest : public testing::Test {
extension_id, type, api_name, page_url, arg_url, days_ago, extension_id, type, api_name, page_url, arg_url, days_ago,
base::BindOnce(&FullStreamUIPolicyTest::CheckWrapper, base::BindOnce(&FullStreamUIPolicyTest::CheckWrapper,
std::move(checker), std::move(checker),
base::MessageLoop::current()->QuitWhenIdleClosure())); base::MessageLoopCurrent::Get()->QuitWhenIdleClosure()));
// Set up a timeout for receiving results; if we haven't received anything // Set up a timeout for receiving results; if we haven't received anything
// when the timeout triggers then assume that the test is broken. // when the timeout triggers then assume that the test is broken.
...@@ -749,7 +749,7 @@ TEST_F(FullStreamUIPolicyTest, CapReturns) { ...@@ -749,7 +749,7 @@ TEST_F(FullStreamUIPolicyTest, CapReturns) {
policy->Flush(); policy->Flush();
GetActivityLogTaskRunner()->PostTaskAndReply( GetActivityLogTaskRunner()->PostTaskAndReply(
FROM_HERE, base::DoNothing(), FROM_HERE, base::DoNothing(),
base::MessageLoop::current()->QuitWhenIdleClosure()); base::MessageLoopCurrent::Get()->QuitWhenIdleClosure());
base::RunLoop().Run(); base::RunLoop().Run();
CheckReadFilteredData( CheckReadFilteredData(
......
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