TIMER_SLACK_NONE is the default thus a no-op.
TIMER_SLACK_MAXIMUM only has effect on mac (UI) MessagePump, though
none of the calls to TIMER_SLACK_MAXIMUM run on a thread that supports it;
blink::MainThreadSchedulerImpl used to be the only meaningful case,
but the message pump was replaced by the default one:
https://chromium-review.googlesource.com/c/chromium/src/+/4369441
ThreadType and DelayPolicy are now used to control thread policies
and timer leeway.
Change-Id: I9638ea298d9cd87843c00eda15513541a512608e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4371223
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1168774}
Now that the circular dependency between browser_thread.h and
browser_task_traits.h has been resolved, browser_thread.h can include
browser_task_traits.h and provide a default ({}) for BrowserTaskTraits.
A bunch of includes in other files needed to be updated.
Bug: 1424788, 1026641, 1429044
Change-Id: Ibc44e495f743eee029fb45832b1084f03ca47555
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4402191
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Michael Thiessen <mthiesse@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1127199}
This CL makes SequenceManager priorities configurable through a new
SequenceManager::Settings option, with a single priority being
configured as the default. This is being done in advance of adding new
renderer-specific priorities to support `scheduler.yield()`, as well
as experimenting with downshifting priorities in backgrounded agents.
Configurable priorities have a few advantages:
- Priority definitions are closer to where they're used, making it
clear what priority system is being used where. This also enables
better semantic (re)naming of priorities in the future, where it
makes sense.
- It prevents render-specific details from creeping into
SequenceManager
- It reduces data structure sizes for sequences that don't use
priorities (currently only renderer main thread, (blink) workers,
and browser UI thread).
SequenceManager is already (mostly) set up to handle an arbitrary
number of priorities; the main non-mechanical changes are:
- A few data structures need to be vectors instead of arrays (this
was cleaner and simpler than templating SequenceManager).
- Tracing needs to support multiple priority systems, which is
implemented with a configurable priority-to-proto-priority
conversion function, along with expanding the proto enum to be the
union of browser, renderer, and worker priorities.
- TaskEnvironment is updated to support configurable priorities in
its constructor, which BrowserTaskEnvironment uses to set up
the required settings for the browser task queues.
- The idle task priority is passed to IdleHelper along with the idle
queue since it differs between main and non-main renderer threads.
I'll try to set this set ahead of time in a follow-up, but this
would have increased the complexity of this CL because of how things
are constructed.
Bug: 979020
Low-Coverage-Reason: pure refactor / missing coverage predated this
Change-Id: I06b47347838c992bcecfe1fe69518c5e8835cdc9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4114556
Commit-Queue: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Francois Pierre Doray <fdoray@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1106608}
Turns out there's a lot of includes, so these will have to be removed
before deleting the implementation of the task runner handles.
To allow the deletion of the task runner handle headers, add
the sequenced/thread task runner handles where they are used in
the codebase with scripts.
This was done with an automated change, with a few touchups afterwards.
The code for the mass-refactor changes are here:
python:
https://paste.googleplex.com/5534570878337024
shell:
https://paste.googleplex.com/6466750748033024
In terms of touchups:
- add sequenced/thread task runner handles to
the third_party/blink/public/DEPS, because multiple files were using
it transitively anyways.
- rewrite certain parts of the codebase which used
ThreadTaskRunnerHandles instead of CurrentDefaultHandles.
- fix a compile issue with forward-declaration in
extensions/browser/extension_file_task_runner.h.
AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I737ef32aee4e77c21eaa3a2bdc403a28322cf1b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4133323
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Sean Maher <spvw@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1090532}
This was initially going to be a prereq for crrev.com/c/4060840
as I wanted to capture unbound creation. Turns out this won't be
sufficient but this is still good code health.
The only true use case for owning a SequenceManagerImpl* is in
thread.cc. Special cased that one with a PassKey.
Bug: 1344573
Change-Id: I1fbb4d97320c6048aff29fdab0a189e7f2071d40
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4061780
Reviewed-by: Etienne Pierre-Doray <etiennep@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1078149}
This CL is a no-op.
Only fixing instances where base::Time (and Ticks/Delta) is used in
a statement (i.e. not as a parameter to avoid adding includes in mere
overrides). Skipping pointer and reference qualified instances.
i.e. matches this regex:
'(\n *[^/\n][^/\n][^/\n]*base::(Time|Thread)(Ticks|Delta)?\b[^*&][^)]*;)'
and skipping files that have any existing fwd-decl for any of the
variants.
This is a prereq to remove unused base/task/post_task.h includes in
https://chromium-review.googlesource.com/c/chromium/src/+/3555247
Bug: 1026641
Change-Id: I87b43a8dc92bdceb67f4bd59b327b54813aa72a6
AX-Relnotes: n/a.
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3557354
Commit-Queue: Gabriel Charette <gab@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#987283}
This CL introduce a service worker specific task queue, and use it for
ServiceWorkerStorageControl mojo remote instead of
base::SequencedTaskRunnerHandle::Get() if
features::kServiceWorkerStorageControlResponseQueue is
enabled. ServiceWorkerStorageControl is a part of the critical path of
the first navigation. We expect that the high priority task runner
provides better startup performance.
The service worker task queue has a highest priority during startup,
and is updated to have a normal priority after startup.
Bug: 1146713
Change-Id: I1cc782486718d62eb319f68b6430faff1d3215b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3503158
Reviewed-by: Hiroki Nakagawa <nhiroki@chromium.org>
Reviewed-by: Kenichi Ishibashi <bashi@chromium.org>
Reviewed-by: Kouhei Ueno <kouhei@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Commit-Queue: Minoru Chikamune <chikamune@chromium.org>
Cr-Commit-Position: refs/heads/main@{#983832}
This CL
(1) splits TimeDomain into 2 classes (extracting some
functionalities into a new interface):
- TimeDomain to provide clock and advancing time
- DelayedWakeUpQueue a queue of (wake ups, TaskQueues) pairs
Reason: Allows us to have a single TimeDomain global to SequenceManager.
This simplifies definition of time; TimeTicks is "consistent" across
all TaskQueues.
(2) Centralizes TimeDoman/TickClock from TaskQueueImpl to
SequenceManagerImpl.
A TimeDomain is a TickClock through inheritance. Note that ownership
is assumed by the user, with the exception or real_time_domain, which
lives in SequenceManagerImpl (this hasn't changed).
Instead of each TaskQueueImpl having its own pointer to
TimeDomain/TickClock, a single pointer to TimeDomain/TickClock is kept
in SequenceManagerImpl, and all TaskQueueImpls access it through
SequenceManagerImpl.
To support multi-threaded access, an atomic pointer to TickClock is
stored in SequenceManagerImpl.
Reason: This let's us update TimeDomain for all TaskQueueImpls at once in
a consistent way instead of iterating and updating each individually.
Note on thread safety: atomic |clock_| sounds dangerous/racy, but it's
ok.
It's safe because all time_domain are expected to never die; except in
some tests but those are done in a single-threaded context.
It's racy (a cross-thread post task may use a stale clock), but
not any more racy than the current implementation. The general
expectation is that time_domain should be switched early on.
DelayedWakeUpQueue is not moved to a new file (yet), so that gerrit can
show the diff properly. Moving to a new file (without any change) will
be done in a follow-up CL.
TimeDomainsAreIndependant unittest is removed because it's no
longer supported to have different TimeDomains on different TaskQueues.
Bug: 857101
Change-Id: Ie220dc135873f147bc2341902179b3942d408198
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2966349
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Scott Haseley <shaseley@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Etienne Pierre-Doray <etiennep@chromium.org>
Cr-Commit-Position: refs/heads/main@{#940744}
This CL was generated by using tools/git/move_source_file.py to change
the includes for those files:
base/bind_post_task.h
base/deferred_sequenced_task_runner.h
base/post_task_and_reply_with_result_internal.h
base/sequenced_task_runner.h
base/sequenced_task_runner_helpers.h
base/single_thread_task_runner.h
base/task_runner.h
base/task_runner_util.h
base/updateable_sequenced_task_runner.h
Then formatted using "git cl format". DEPS files were fixed with a
simple search and replace script.
Bug: 1255932
Change-Id: I0d9b5ddd9260fde5e4581e6c6e0080bdb0ed2c44
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3209175
Reviewed-by: Gabriel Charette <gab@chromium.org>
Owners-Override: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/main@{#929867}
This replaces DISALLOW_COPY_AND_ASSIGN with explicit constructor deletes
where a local script is able to detect its insertion place (~Foo() is
public => insert before this line).
This is incomplete as not all classes have a public ~Foo() declared, so
not all DISALLOW_COPY_AND_ASSIGN occurrences are replaced.
IWYU cleanup is left as a separate pass that is easier when these macros
go away.
Bug: 1010217
Change-Id: Iea478401b7580682c7b9f195f7af9cbbdb6ce315
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3167292
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Owners-Override: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/main@{#923194}
Note to QA: This CL is purely mechanical and shouldn't be blamed
for future regressions on touched files.
This is a follow-up to https://chromium-review.googlesource.com/c/chromium/src/+/2211138
which already removed all usage using content::BrowserThread.
Hence this script now matches unqualified BrowserThread:: without
risking having "content::" be selected as "traits_before" by the regex
(ran on same revision as step #1).
content:: is now always added if outside namespace content {}
(deleting unused using content::BrowserThread; decls)
Script @ https://crbug.com/1026641#c92
(will TBR fdoray@ post-review for mechanical change)
TBR=fdoray@hchromium.org
AX-Relnotes: n/a.
Bug: 1026641
Change-Id: I51ae2f83eb17d19b54563fd9b4fc040d2aa0c948
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2212469
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772458}
No less than 6.5 years after TestBrowserThread was deprecated!
Moved as-is to browser_task_environment.cc % deletion on an unused constructor.
Only actual change in this CL is in
chrome/browser/android/digital_asset_links/digital_asset_links_handler_unittest.cc
to use BrowserTaskEnvironment instead (doesn't alter any logic, just
semantics).
// For minor tweaks to chrome/browser/android/digital_asset_links/digital_asset_links_handler_unittest.cc
TBR=lizeb@chromium.org
// To bypass owners on mechanical removal of unused headers.
TBR=avi@chromium.org
Bug: 272091
Change-Id: I174c23ae436c330b32f14bd12ff5f9dc4e23bab2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1978162
Commit-Queue: Gabriel Charette <gab@chromium.org>
Reviewed-by: Avi Drissman <avi@chromium.org>
Auto-Submit: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726871}
This trait will allow tasks to be posted on the current thread, optionally
overriding other traits such as the base::TaskPriority or
content::BrowserTaskType. A refactor of BrowserTaskExecutor was necessary
to support ase::CurrentThread in a BrowserTaskEnvironment with a fake IO
thread.
BUG:
Change-Id: If4627c8cec6efd404b483c5a9b789a579c00936b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1835494
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alex Moshchuk <alexmos@chromium.org>
Reviewed-by: François Doray <fdoray@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704181}
This is a reland of 18947083c7
The move_source_file.py script's formatting rules incorrectly
formatted services/device/generic_sensor/platform_sensor_and_provider_unittest_win.cc
after all. But we also can't rely 100% on git cl format (crbug.com/997063)
so I ended up performing a git cl format && git add -up
(+interactive addition of missing blank line after foo.h when included
from top of foo.cc)
Also added
$ tools/git/move_source_file.py net/test/test_with_scoped_task_environment.h net/test/test_with_task_environment.h
Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}
TBR=dcheng@chromium.org
Bug: 992483
Change-Id: I6179dd1329a4d30bf5c65450ea893537f31e6f85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767658
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689794}
This reverts commit 18947083c7.
Reason for revert: broke Win
Original change's description:
> [TaskEnvironment] Complete migration with header rename
>
> This is merely:
>
> $ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
> $ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
> $ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
> $ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
> $ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
> $ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
>
> and a few manual renames in DEPS files missed by the script
>
> This CL uses --bypass-hooks to avoid having to git cl format because
> many headers are being reordered by git cl format and it's too many to
> figure out in a no-op CL which ones are okay with it.
> windows.h for one should typically be first and another one of the
> reorderings in PS3 even caused a compile failure:
> https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.cc
>
> TBR=dcheng@chromium.org
>
> Bug: 992483
> Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Reviewed-by: Daniel Cheng <dcheng@chromium.org>
> Commit-Queue: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#689778}
TBR=dcheng@chromium.org,gab@chromium.org
Change-Id: I9aa8ff558d1ff78cebe0c25e559c017578ad4f53
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 992483
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1767657
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689780}
This is merely:
$ tools/git/move_source_file.py base/test/scoped_task_environment.h base/test/task_environment.h
$ tools/git/move_source_file.py base/test/scoped_task_environment.cc base/test/task_environment.cc
$ tools/git/move_source_file.py base/test/scoped_task_environment_unittest.cc base/test/task_environment_unittest.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.h content/public/test/browser_task_environment.h
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle.cc content/public/test/browser_task_environment.cc
$ tools/git/move_source_file.py content/public/test/test_browser_thread_bundle_unittest.cc content/public/test/browser_task_environment_unittest.cc
$ tools/git/move_source_file.py ios/web/public/test/test_web_thread_bundle.h ios/web/public/test/web_task_environment.h
$ tools/git/move_source_file.py ios/web/test/test_web_thread_bundle.cc ios/web/test/web_task_environment.cc
and a few manual renames in DEPS files missed by the script
This CL uses --bypass-hooks to avoid having to git cl format because
many headers are being reordered by git cl format and it's too many to
figure out in a no-op CL which ones are okay with it.
windows.h for one should typically be first and another one of the
reorderings in PS3 even caused a compile failure:
https://chromium-review.googlesource.com/c/chromium/src/+/1764962/3/components/services/font/font_loader_unittest.ccTBR=dcheng@chromium.org
Bug: 992483
Change-Id: I32a4afd43ef779393c95d9873c157be2d3da1dd1
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1764962
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#689778}
(well half of them because git cl upload wouldn't let me do
them all at once...)
This is step #1 of the mass migration. Some of these will be
backported to SingleThreadTaskEnvironment in a later phase.
scoped_task_environment.h will also only move in a follow-up CL.
TBR=dcheng@chromium.org
Bug: 992483
Change-Id: I44bc376deee9b6c95bafac8d54165174d86a5001
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1756247
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Daniel Cheng <dcheng@chromium.org>
Commit-Queue: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688086}
This reverts commit 8f5f3e89a5.
Reason for revert: Revert wasn't needed
Original change's description:
> Revert "Reland "Remove references to MessagePump::Type""
>
> This reverts commit 1c1d61e5d9.
>
> Reason for revert: I suspect this is causing a compile failure on the Linux ChromiumOS Full Bot.
>
> Output:
> FAILED: obj/chromeos/services/assistant/tests/service_unittest.o
> /b/s/w/ir/cache/goma/client/gomacc ../../third_par...
> ../../chromeos/services/assistant/service_unittest.cc:12:10: fatal error: 'ash/public/interfaces/constants.mojom-forward.h' file not found
> #include "ash/public/interfaces/constants.mojom-forward.h"
> ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
>
> Original change's description:
> > Reland "Remove references to MessagePump::Type"
> >
> > This is a reland of bfca9d675c
> >
> > Was reverted because an optional trybot failed due to a missing include in an unrelated file.
> > That was fixed in https://crrev.com/c/1729634 and https://crrev.com/c/1730894
> >
> > Original change's description:
> > > Remove references to MessagePump::Type
> > >
> > > It is going away soon, replace with the real thing: MessagePumpType
> > >
> > > Had to fix a lot of includes (MessagePumpType is defined in message_pump_type.h).
> > >
> > > This is a mechanical change that will be reviewed according to
> > > https://chromium.googlesource.com/chromium/src/+/master/docs/code_reviews.md#mechanical-changes
> > >
> > > Bug: 891670
> > > TBR=gab@chromium.org
> > >
> > > Change-Id: I1c85fce3cc11f7a283153ccaf2596e6e92a638d7
> > > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726058
> > > Commit-Queue: Carlos Caballero <carlscab@google.com>
> > > Reviewed-by: Gabriel Charette <gab@chromium.org>
> > > Cr-Commit-Position: refs/heads/master@{#682731}
> >
> > TBR=gab@chromium.org
> >
> > Bug: 891670
> > Change-Id: I7654fb4ff3a5e8c0505aafb33939d2035f28f88b
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730416
> > Commit-Queue: Carlos Caballero <carlscab@google.com>
> > Reviewed-by: Gabriel Charette <gab@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#683592}
>
> TBR=gab@chromium.org,carlscab@google.com
>
> Change-Id: Ie479741cf8092d9110a9ee6c5fa81e7e084c6788
> No-Presubmit: true
> No-Tree-Checks: true
> No-Try: true
> Bug: 891670
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733432
> Reviewed-by: Chris Sharp <csharp@chromium.org>
> Commit-Queue: Chris Sharp <csharp@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#683602}
TBR=gab@chromium.org,csharp@chromium.org,carlscab@google.com
Change-Id: Ieb323e7afaf248384c05b8cb0c13d6ec50856c75
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733434
Reviewed-by: Chris Sharp <csharp@chromium.org>
Commit-Queue: Chris Sharp <csharp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683603}
This reverts commit 1c1d61e5d9.
Reason for revert: I suspect this is causing a compile failure on the Linux ChromiumOS Full Bot.
Output:
FAILED: obj/chromeos/services/assistant/tests/service_unittest.o
/b/s/w/ir/cache/goma/client/gomacc ../../third_par...
../../chromeos/services/assistant/service_unittest.cc:12:10: fatal error: 'ash/public/interfaces/constants.mojom-forward.h' file not found
#include "ash/public/interfaces/constants.mojom-forward.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Original change's description:
> Reland "Remove references to MessagePump::Type"
>
> This is a reland of bfca9d675c
>
> Was reverted because an optional trybot failed due to a missing include in an unrelated file.
> That was fixed in https://crrev.com/c/1729634 and https://crrev.com/c/1730894
>
> Original change's description:
> > Remove references to MessagePump::Type
> >
> > It is going away soon, replace with the real thing: MessagePumpType
> >
> > Had to fix a lot of includes (MessagePumpType is defined in message_pump_type.h).
> >
> > This is a mechanical change that will be reviewed according to
> > https://chromium.googlesource.com/chromium/src/+/master/docs/code_reviews.md#mechanical-changes
> >
> > Bug: 891670
> > TBR=gab@chromium.org
> >
> > Change-Id: I1c85fce3cc11f7a283153ccaf2596e6e92a638d7
> > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1726058
> > Commit-Queue: Carlos Caballero <carlscab@google.com>
> > Reviewed-by: Gabriel Charette <gab@chromium.org>
> > Cr-Commit-Position: refs/heads/master@{#682731}
>
> TBR=gab@chromium.org
>
> Bug: 891670
> Change-Id: I7654fb4ff3a5e8c0505aafb33939d2035f28f88b
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1730416
> Commit-Queue: Carlos Caballero <carlscab@google.com>
> Reviewed-by: Gabriel Charette <gab@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#683592}
TBR=gab@chromium.org,carlscab@google.com
Change-Id: Ie479741cf8092d9110a9ee6c5fa81e7e084c6788
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733432
Reviewed-by: Chris Sharp <csharp@chromium.org>
Commit-Queue: Chris Sharp <csharp@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683602}
*** Note: There is no behavior change from this patch. ***
The PostTask APIs will shortly be changed to require all tasks to explicitly
specify their thread affinity, i.e., whether the task should run on the thread
pool or a specific named thread such as a BrowserThread. This patch updates all
call sites with thread affinity annotation. We also remove the "WithTraits"
suffix to make the call sites more readable.
Before:
// Thread pool task.
base::PostTaskWithTraits(FROM_HERE, {...}, ...);
// UI thread task.
base::PostTaskWithTraits(FROM_HERE, {BrowserThread::UI, ...}, ...);
After:
// Thread pool task.
base::PostTask(FROM_HERE, {base::ThreadPool(), ...}, ...);
// UI thread task.
base::PostTask(FROM_HERE, {BrowserThread::UI, ...}, ...);
This patch was semi-automatically prepared with these steps:
1. Patch in https://chromium-review.googlesource.com/c/chromium/src/+/1635827
to make thread affinity a build-time requirement.
2. Run an initial pass with a clang rewriter:
https://chromium-review.googlesource.com/c/chromium/src/+/1635623
3. ninja -C out/Debug | grep 'requested here' | cut -d: -f1-3 | sort | \
uniq > errors.txt
4. while read line; do
f=$(echo $line | cut -d: -f 1)
r=$(echo $line | cut -d: -f 2)
c=$(echo $line | cut -d: -f 3)
sed -i "${r}s/./&base::ThreadPool(),/$c" $f
done < errors.txt
5. GOTO 3 until build succeeds.
6. Remove the "WithTraits" suffix from task API call sites:
$ tools/git/mffr.py -i <(cat <<EOF
[
["PostTaskWithTraits", "PostTask"],
["PostDelayedTaskWithTraits", "PostDelayedTask"],
["PostTaskWithTraitsAndReply", "PostTaskAndReply"],
["CreateTaskRunnerWithTraits", "CreateTaskRunner"],
["CreateSequencedTaskRunnerWithTraits", "CreateSequencedTaskRunner"],
["CreateUpdateableSequencedTaskRunnerWithTraits", "CreateUpdateableSequencedTaskRunner"],
["CreateSingleThreadTaskRunnerWithTraits", "CreateSingleThreadTaskRunner"],
["CreateCOMSTATaskRunnerWithTraits", "CreateCOMSTATaskRunner"]
]
EOF
)
This CL was uploaded by git cl split.
R=boliu@chromium.org, tsepez@chromium.org
Bug: 968047
Change-Id: I346372d16a3856186ea74d14e0dd8a12f7cacae5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1729589
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Reviewed-by: Bo <boliu@chromium.org>
Auto-Submit: Sami Kyöstilä <skyostil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#683554}
In some circumstanecs you need to specify a BrowserTaskType or a priority when
posting a task from the IO theread to the UI thread or you risk inadvertant
task reordering. This patch introduces ScopedDoNotUseUIDefaultQueueFromIO an
RAII helper which causes PostTask on the UI thread's default task queue from
the IO thread to DCHECK.
The idea is to place ScopedDoNotUseUIDefaultQueueFromIO in contexts where
you're explicitly prioritizing certain tasks and it will guard against future
PostTasks which might otherwise get flakily reordered.
Bug: 863341
Change-Id: I67a56b2747b8bdd1ef35ec3652b55f1dc7ea830c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1660340
Reviewed-by: Nasko Oskov <nasko@chromium.org>
Reviewed-by: Alexander Timin <altimin@chromium.org>
Reviewed-by: Sami Kyöstilä <skyostil@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#672823}
A large but mostly trivial patch in preparation for removing
base::MessageLoop. We introduce SingleThreadTaskExecutor a simple FIFO
scheduler, which is intended for non-test code that needs a simple
single threaded task environment. Tests should use ScopedTaskEnvironment
or TestBrowserThreadBundle instead.
This patch also moves MessageLoop::Type to MessagePump::Type and
moves the factory method to MessagePump::Create.
TBR=gab@chromium.org
Change-Id: I9850c4657bb90b62490f4313c420cae025101371
BUG: 891670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1632216
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Commit-Queue: Alex Clarke <alexclarke@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664709}
This helper will be useful when migrating code away from
PostAfterStartupTask. Some callsites would otherwise need a trampoline
as they need to post to a given task runner. This helper is only needed
until we have sequence-funneling in place.
This patch is a split of https://crrev.com/c/1571661. Refer to this if
you need more context for this change.
Bug: 887407
Change-Id: I122f837e6a7b509903055798deb0f2b6eb215bed
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1628725
Commit-Queue: Carlos Caballero <carlscab@google.com>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Cr-Commit-Position: refs/heads/master@{#663717}
After this patch all queues in BrowserTaskQueues will be disabled on
creation and users must explicitly enable them via a call to either
BrowserTaskQueues::EnableAllQueues or
BrowserTaskQueues::EnableAllExceptBestEffortQueues
This will help us ensure the invariant that no tasks will run before
BrowserMainLoop::CreateThreads still holds after we add an IO
scheduler.
Bug: 863341
Change-Id: I07d34ec84e166b12b9ab50448acde7f943f9cbbb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1611979
Reviewed-by: Scott Violet <sky@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Alex Clarke <alexclarke@chromium.org>
Commit-Queue: Carlos Caballero <carlscab@google.com>
Cr-Commit-Position: refs/heads/master@{#661772}