Commit 79d4a3ea authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

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

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

Bug: 1026641
Change-Id: I3c723c41dc313d8eaa664260c7569a7bde398076
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216737
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Marijn Kruisselbrink <mek@chromium.org>
Reviewed-by: default avatarMarijn Kruisselbrink <mek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772281}
parent 7924ef79
......@@ -17,6 +17,7 @@
#include "base/strings/utf_string_conversions.h"
#include "base/task/lazy_thread_pool_task_runner.h"
#include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "content/browser/child_process_security_policy_impl.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_task_traits.h"
......@@ -168,8 +169,8 @@ void SyncGetPlatformPath(storage::FileSystemContext* context,
if (!FileSystemURLIsValid(context, url)) {
// Note: Posting a task here so this function always returns
// before the callback is called no matter which path is taken.
base::PostTask(FROM_HERE,
base::BindOnce(std::move(callback), base::FilePath()));
base::ThreadPool::PostTask(
FROM_HERE, base::BindOnce(std::move(callback), base::FilePath()));
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