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

[base] Make PostTask destination explicit in /chrome/browser/chromeos/arc

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

Bug: 1026641
Change-Id: I80631256980fa0f28c273c2bd8f9531e68628791
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2217204
Auto-Submit: Gabriel Charette <gab@chromium.org>
Commit-Queue: Yusuke Sato <yusukes@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772134}
parent ac2394c6
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/system/sys_info.h" #include "base/system/sys_info.h"
#include "base/task/post_task.h" #include "base/task/post_task.h"
#include "base/task/thread_pool.h"
#include "base/threading/thread_task_runner_handle.h" #include "base/threading/thread_task_runner_handle.h"
#include "base/time/time.h" #include "base/time/time.h"
#include "chrome/browser/chromeos/profiles/profile_helper.h" #include "chrome/browser/chromeos/profiles/profile_helper.h"
...@@ -3060,9 +3061,10 @@ ArcBluetoothBridge::RfcommCreateConnectSocket(mojom::BluetoothAddressPtr addr, ...@@ -3060,9 +3061,10 @@ ArcBluetoothBridge::RfcommCreateConnectSocket(mojom::BluetoothAddressPtr addr,
if (ret == 0) { if (ret == 0) {
// connect() returns success immediately. // connect() returns success immediately.
sock_wrapper->file = std::move(sock); sock_wrapper->file = std::move(sock);
PostTask(FROM_HERE, base::ThreadPool::PostTask(
base::BindOnce(&ArcBluetoothBridge::OnRfcommConnectingSocketReady, FROM_HERE,
weak_factory_.GetWeakPtr(), sock_wrapper.get())); base::BindOnce(&ArcBluetoothBridge::OnRfcommConnectingSocketReady,
weak_factory_.GetWeakPtr(), sock_wrapper.get()));
return sock_wrapper; return sock_wrapper;
} }
if (errno != EINPROGRESS) { if (errno != EINPROGRESS) {
......
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