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

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

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

Bug: 1026641
Change-Id: Iccaebd459d36f82f2d3ae21ffa6bb83a19321ead
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216738Reviewed-by: default avatarTakashi Toyoshima <toyoshim@chromium.org>
Commit-Queue: Takashi Toyoshima <toyoshim@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#773956}
parent a8007c93
...@@ -17,10 +17,10 @@ ...@@ -17,10 +17,10 @@
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/task/post_task.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/test/scoped_feature_list.h" #include "base/test/scoped_feature_list.h"
#include "base/threading/thread_restrictions.h" #include "base/threading/thread_restrictions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "content/browser/site_instance_impl.h" #include "content/browser/site_instance_impl.h"
#include "content/public/browser/browser_task_traits.h" #include "content/public/browser/browser_task_traits.h"
...@@ -310,9 +310,10 @@ class RequestInterceptor { ...@@ -310,9 +310,10 @@ class RequestInterceptor {
} }
if (!got_all_data) { if (!got_all_data) {
base::PostTask(FROM_HERE, base::BindOnce(&RequestInterceptor::ReadBody, base::ThreadTaskRunnerHandle::Get()->PostTask(
base::Unretained(this), FROM_HERE,
std::move(completion_callback))); base::BindOnce(&RequestInterceptor::ReadBody, base::Unretained(this),
std::move(completion_callback)));
} else { } else {
std::move(completion_callback).Run(); std::move(completion_callback).Run();
} }
......
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