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

Migrate MessageLoop::current() to MessageLoopCurrent in /chromecast

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

Bug: 825327
Change-Id: I01b6eb1a65d3989f830b34c989ec5a8bbf0ffe41
Reviewed-on: https://chromium-review.googlesource.com/1024530Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarStephen Lanham <slan@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553622}
parent a9d8462a
......@@ -16,6 +16,7 @@
#include "base/macros.h"
#include "base/memory/ptr_util.h"
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_current.h"
#include "base/path_service.h"
#include "base/run_loop.h"
#include "base/single_thread_task_runner.h"
......@@ -391,7 +392,7 @@ void CastBrowserMainParts::PostMainMessageLoopStart() {
base::ThreadTaskRunnerHandle::Get()));
#if defined(OS_ANDROID)
base::MessageLoopForUI::current()->Start();
base::MessageLoopCurrentForUI::Get()->Start();
#endif // defined(OS_ANDROID)
}
......@@ -591,7 +592,8 @@ bool CastBrowserMainParts::MainMessageLoopRun(int* result_code) {
// If parameters_.ui_task is not NULL, we are running browser tests.
if (parameters_.ui_task) {
base::MessageLoop* message_loop = base::MessageLoopForUI::current();
base::MessageLoopCurrent message_loop =
base::MessageLoopCurrentForUI::Get();
message_loop->task_runner()->PostTask(FROM_HERE, *parameters_.ui_task);
message_loop->task_runner()->PostTask(FROM_HERE, quit_closure);
}
......
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