Commit 7e678c55 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in /chrome/test/chromedriver

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=stgao@chromium.org

Bug: 825327
Change-Id: Id0af6c00456644d29aa8553a9bafab0a2d92bb4f
Reviewed-on: https://chromium-review.googlesource.com/1024479
Commit-Queue: John Chen <johnchen@chromium.org>
Reviewed-by: default avatarJohn Chen <johnchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553016}
parent fd62e47f
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
#include "base/logging.h" #include "base/logging.h"
#include "base/memory/linked_ptr.h" #include "base/memory/linked_ptr.h"
#include "base/memory/ptr_util.h" #include "base/memory/ptr_util.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/stl_util.h" #include "base/stl_util.h"
...@@ -133,7 +133,7 @@ void ExecuteGetSessions(const Command& session_capabilities_command, ...@@ -133,7 +133,7 @@ void ExecuteGetSessions(const Command& session_capabilities_command,
} }
base::ThreadTaskRunnerHandle::Get()->PostDelayedTask( base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(10)); FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(10));
base::MessageLoop::current()->SetNestableTasksAllowed(true); base::MessageLoopCurrent::Get()->SetNestableTasksAllowed(true);
run_loop.Run(); run_loop.Run();
callback.Run(Status(kOk), std::move(session_list), session_id, false); callback.Run(Status(kOk), std::move(session_list), session_id, false);
...@@ -185,7 +185,7 @@ void ExecuteQuitAll( ...@@ -185,7 +185,7 @@ void ExecuteQuitAll(
FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(10)); FROM_HERE, run_loop.QuitClosure(), base::TimeDelta::FromSeconds(10));
// Uses a nested run loop to block this thread until all the quit // Uses a nested run loop to block this thread until all the quit
// commands have executed, or the timeout expires. // commands have executed, or the timeout expires.
base::MessageLoop::current()->SetNestableTasksAllowed(true); base::MessageLoopCurrent::Get()->SetNestableTasksAllowed(true);
run_loop.Run(); run_loop.Run();
callback.Run(Status(kOk), std::unique_ptr<base::Value>(), callback.Run(Status(kOk), std::unique_ptr<base::Value>(),
session_id, false); session_id, false);
......
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