Commit 1d53a361 authored by Gabriel Charette's avatar Gabriel Charette Committed by Commit Bot

Reland "Reland "Reland "Reland [base] Require task posters to specify an explicit destination"""

This is a reland of 0567f059

Reason for reland:
 - joelhockey@ fixed the chromeos build in
   https://chromium-review.googlesource.com/c/chromium/src/+/1767447

Original change's description:
> Reland "Reland "Reland [base] Require task posters to specify an explicit destination""
>
> This is a reland of d7b74986
>
> As usual, if this fails **please** paste the build failure, not just
> silent revert, logs can be hard to find in retrospect.
>
> Reason for reland:
>  - joenotcharles@ fixed the windows build in
>    https://chromium-review.googlesource.com/c/chromium/src/+/1764471
>  - google chromeos build failure fixed in
>    https://chromium-review.googlesource.com/c/chromium/src/+/1764256
>
> Original change's description:
> > Reland "Reland [base] Require task posters to specify an explicit destination"
> >
> > This is a reland of dd34a877
> >
> > Rebased on a few more fixes including a local full build of:
> >  - Windows + is_chrome_branded
> >  - ChromeOS + is_chrome_branded
> >    (except for the libassistant portion which is giving weird errors...)
> >
> > Original change's description:
> > > Reland [base] Require task posters to specify an explicit destination
> > >
> > > This patch makes it a requirement for all task traits to specify their
> > > thread affinity. Previously task traits that did not name a specific
> > > thread would implicitly run on the thread pool, which could be
> > > surprising. To make this more obvious, thread pool tasks must now use
> > > the base::ThreadPool() trait.
> > >
> > > This is the final reland of
> > > https://chromium-review.googlesource.com/c/chromium/src/+/1635827
> > > (will attempt to fix errors that caused original revert before
> > >  relanding).
> > >
> > > Bug: 968047
> > > Change-Id: Ice339db270a27815b2be68200930e5bc105e8a96
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1759056
> > > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > > Reviewed-by: François Doray <fdoray@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#688782}
> >
> > Bug: 968047
> > Change-Id: Iccd12e0a9f1535cb10b903777c5004a7d1acb34a
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761362
> > Commit-Queue: Gabriel Charette <gab@chromium.org>
> > Reviewed-by: François Doray <fdoray@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#689097}
>
> Bug: 968047
> Change-Id: Ie338781aba9b5f5990ffe74e02bb85f08fe683d1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764398
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Reviewed-by: François Doray <fdoray@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689665}

Bug: 968047
Change-Id: Idca1ec9ef83aad51def481b2ed4f8f1baf1385da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769080Reviewed-by: default avatarFrançois Doray <fdoray@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690346}
parent 5f42a0c6
...@@ -255,7 +255,21 @@ class BASE_EXPORT TaskTraits { ...@@ -255,7 +255,21 @@ class BASE_EXPORT TaskTraits {
may_block_(trait_helpers::HasTrait<MayBlock, ArgTypes...>()), may_block_(trait_helpers::HasTrait<MayBlock, ArgTypes...>()),
with_base_sync_primitives_( with_base_sync_primitives_(
trait_helpers::HasTrait<WithBaseSyncPrimitives, ArgTypes...>()), trait_helpers::HasTrait<WithBaseSyncPrimitives, ArgTypes...>()),
use_thread_pool_(trait_helpers::HasTrait<ThreadPool, ArgTypes...>()) {} use_thread_pool_(trait_helpers::HasTrait<ThreadPool, ArgTypes...>()) {
#if !defined(OS_CHROMEOS)
// TODO(https://crbug.com/968047): Enable on Chrome OS in a separate CL.
// Initially disabled to keep the rule enforced on other platforms if the
// CL that enables it on Chrome OS is reverted.
constexpr bool has_thread_pool =
trait_helpers::HasTrait<ThreadPool, ArgTypes...>();
constexpr bool has_extension =
!trait_helpers::AreValidTraits<ValidTrait, ArgTypes...>::value;
static_assert(
has_thread_pool ^ has_extension,
"Traits must explicitly specify a destination (e.g. ThreadPool or a "
"named thread like BrowserThread)");
#endif
}
constexpr TaskTraits(const TaskTraits& other) = default; constexpr TaskTraits(const TaskTraits& other) = default;
TaskTraits& operator=(const TaskTraits& other) = default; TaskTraits& operator=(const TaskTraits& other) = default;
......
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