Commit c671922c authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[base] Make PostTask destination explicit in /chrome/browser/bitmap_fetcher

Task APIs v3 will all have an explicit destination. In the past
"default traits" meant ThreadPool. These CLs are thus a no-op
except for the few callers that clearly wanted to post a QuitClosure()
on the current thread (posting a QuitClosure() to a parallel task will
merely bounce it back to the current thread anyways). Those few callers
were migrated to ThreadTaskRunnerHandle::Get().

These changes are thus required to phase out task APIs v2 (post_task.h)
Design doc: https://docs.google.com/document/d/1tssusPykvx3g0gvbvU4HxGyn3MjJlIylnsH13-Tv6s4/edit

This specific change is a subset of
https://chromium-review.googlesource.com/c/chromium/src/+/2216733

This CL was uploaded by git cl split.

R=petewil@chromium.org

Bug: 1026641
Change-Id: Id676174f093ce32d2cc691ca2deb8415f0b95c0a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217203
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Peter Williamson <petewil@chromium.org>
Reviewed-by: default avatarPeter Williamson <petewil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772287}
parent 7dcc6231
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h" #include "chrome/browser/bitmap_fetcher/bitmap_fetcher.h"
#include "base/bind.h" #include "base/bind.h"
#include "base/task/post_task.h" #include "base/task/thread_pool.h"
#include "content/public/browser/browser_context.h" #include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h" #include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h" #include "content/public/browser/storage_partition.h"
...@@ -52,8 +52,8 @@ void BitmapFetcher::Start(network::mojom::URLLoaderFactory* loader_factory) { ...@@ -52,8 +52,8 @@ void BitmapFetcher::Start(network::mojom::URLLoaderFactory* loader_factory) {
// Post a task to maintain our guarantee that the delegate will only be // Post a task to maintain our guarantee that the delegate will only be
// called asynchronously. // called asynchronously.
base::PostTask(FROM_HERE, base::ThreadPool::PostTask(
BindOnce(std::move(callback), std::move(response_body))); FROM_HERE, BindOnce(std::move(callback), std::move(response_body)));
return; return;
} }
......
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