Commit 24e8289b authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

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

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

Bug: 825327
Change-Id: I18dfde173f4dec69a3ab5040a0f62e1e09005fce
Reviewed-on: https://chromium-review.googlesource.com/1024394Reviewed-by: default avatarGabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553633}
parent 564d6622
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "chrome/browser/extensions/favicon_downloader.h" #include "chrome/browser/extensions/favicon_downloader.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/message_loop/message_loop.h" #include "base/message_loop/message_loop_current.h"
#include "components/favicon/content/content_favicon_driver.h" #include "components/favicon/content/content_favicon_driver.h"
#include "content/public/browser/navigation_handle.h" #include "content/public/browser/navigation_handle.h"
#include "content/public/browser/web_contents.h" #include "content/public/browser/web_contents.h"
...@@ -93,7 +93,7 @@ void FaviconDownloader::FetchIcons(const std::vector<GURL>& urls) { ...@@ -93,7 +93,7 @@ void FaviconDownloader::FetchIcons(const std::vector<GURL>& urls) {
// If no downloads were initiated, we can proceed directly to running the // If no downloads were initiated, we can proceed directly to running the
// callback. // callback.
if (in_progress_requests_.empty() && !need_favicon_urls_) { if (in_progress_requests_.empty() && !need_favicon_urls_) {
base::MessageLoop::current()->task_runner()->PostTask( base::MessageLoopCurrent::Get()->task_runner()->PostTask(
FROM_HERE, base::BindOnce(callback_, true, favicon_map_)); FROM_HERE, base::BindOnce(callback_, true, favicon_map_));
} }
} }
......
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