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

[base] Make PostTask destination explicit in /chromeos/components/nearby

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

Bug: 1026641
Change-Id: If8c3e0326a77e5ffca7f6e885cbda1bd37c0b3d4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2216735
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Ryan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772272}
parent 7aa0f4c2
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/single_thread_task_runner.h" #include "base/single_thread_task_runner.h"
#include "base/task/post_task.h" #include "base/task/thread_pool.h"
#include "base/test/gtest_util.h" #include "base/test/gtest_util.h"
#include "base/test/task_environment.h" #include "base/test/task_environment.h"
#include "base/test/test_timeouts.h" #include "base/test/test_timeouts.h"
...@@ -99,7 +99,7 @@ class ConditionVariableImplTest : public testing::Test { ...@@ -99,7 +99,7 @@ class ConditionVariableImplTest : public testing::Test {
FakeLock* fake_lock() { return fake_lock_.get(); } FakeLock* fake_lock() { return fake_lock_.get(); }
void WaitOnConditionVariableFromParallelSequence(bool should_succeed) { void WaitOnConditionVariableFromParallelSequence(bool should_succeed) {
base::PostTask( base::ThreadPool::PostTask(
FROM_HERE, FROM_HERE,
base::BindOnce(&ConditionVariableImplTest::WaitOnConditionVariable, base::BindOnce(&ConditionVariableImplTest::WaitOnConditionVariable,
base::Unretained(this), should_succeed)); base::Unretained(this), should_succeed));
......
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