Commit 9524bf27 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

[base] Make PostTask destination explicit in /content/browser/web_package

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

Bug: 1026641
Change-Id: I7f14fa5fdc132e2d0760a7013147e69af3e5275f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217206
Commit-Queue: Gabriel Charette <gab@chromium.org>
Commit-Queue: Kunihiko Sakamoto <ksakamoto@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: default avatarKunihiko Sakamoto <ksakamoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772126}
parent 9ce38354
...@@ -188,7 +188,7 @@ void WebBundleReader::ReadResponse( ...@@ -188,7 +188,7 @@ void WebBundleReader::ReadResponse(
auto it = entries_.find(net::SimplifyUrlForRequest(resource_request.url)); auto it = entries_.find(net::SimplifyUrlForRequest(resource_request.url));
if (it == entries_.end() || it->second->response_locations.empty()) { if (it == entries_.end() || it->second->response_locations.empty()) {
PostTask( base::ThreadPool::PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
std::move(callback), nullptr, std::move(callback), nullptr,
...@@ -206,7 +206,7 @@ void WebBundleReader::ReadResponse( ...@@ -206,7 +206,7 @@ void WebBundleReader::ReadResponse(
accept_langs); accept_langs);
auto found = matcher.FindBestMatchingIndex(entry->variants_value); auto found = matcher.FindBestMatchingIndex(entry->variants_value);
if (!found || *found >= entry->response_locations.size()) { if (!found || *found >= entry->response_locations.size()) {
PostTask( base::ThreadPool::PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce( base::BindOnce(
std::move(callback), nullptr, std::move(callback), nullptr,
...@@ -279,7 +279,7 @@ void WebBundleReader::DidReconnect(base::Optional<std::string> error) { ...@@ -279,7 +279,7 @@ void WebBundleReader::DidReconnect(base::Optional<std::string> error) {
if (error) { if (error) {
for (auto& pair : read_tasks) { for (auto& pair : read_tasks) {
PostTask( base::ThreadPool::PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(std::move(pair.second), nullptr, base::BindOnce(std::move(pair.second), nullptr,
data_decoder::mojom::BundleResponseParseError::New( data_decoder::mojom::BundleResponseParseError::New(
......
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