Commit 74b0a582 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Migrate MessageLoop::current() to MessageLoopCurrent in /ui/events

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

Bug: 825327
Change-Id: Id090f93a7156fcef4c60defd5fb6bc2682e732af
Reviewed-on: https://chromium-review.googlesource.com/1024650Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553753}
parent 80dca7a2
......@@ -6,7 +6,7 @@
#include <memory>
#include "base/message_loop/message_loop.h"
#include "base/message_loop/message_loop_current.h"
#include "ui/events/event.h"
#include "ui/events/event_utils.h"
#include "ui/events/keycodes/keyboard_code_conversion_x.h"
......@@ -197,11 +197,11 @@ void X11EventSourceLibevent::ProcessXEvent(XEvent* xevent) {
void X11EventSourceLibevent::AddEventWatcher() {
if (initialized_)
return;
if (!base::MessageLoop::current())
if (!base::MessageLoopCurrent::Get())
return;
int fd = ConnectionNumber(event_source_.display());
base::MessageLoopForUI::current()->WatchFileDescriptor(
base::MessageLoopCurrentForUI::Get()->WatchFileDescriptor(
fd, true, base::MessagePumpLibevent::WATCH_READ, &watcher_controller_,
this);
initialized_ = true;
......
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