Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(103)

Issue 2464963002: TaskScheduler: Remove base::ExecutionMode. (Closed)

Created:
4 years, 1 month ago by fdoray
Modified:
4 years, 1 month ago
Reviewers:
robliao, danakj, gab
CC:
chromium-reviews, gab+watch_chromium.org, robliao+watch_chromium.org, fdoray+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

TaskScheduler: Remove base::ExecutionMode. Instead of a single function that takes a base::ExecutionMode as argument, post_task.h now exposes one task runner creation function per execution mode. These functions return typed task runners. scoped_refptr<TaskRunner> CreateTaskRunnerWithTraits(TaskTraits); scoped_refptr<SequencedTaskRunner> CreateSequencedTaskRunnerWithTraits(TaskTraits); scoped_refptr<SingleThreadTaskRunner> CreateSingleThreadTaskRunnerWithTraits(TaskTraits); We had originally explicitly opted against providing typed TaskRunners per them lacking all other traits and thus merely being weakly typed (a compile time name for every combination of trait would be ridiculous). It is however now becoming obvious that the ExecutionMode is by far the most important type to spread through the codebase as having a compile time guarantee that something is single-threaded or sequenced is a pretty big deal and such usage is spread throughout the codebase already. Other traits (e.g. file I/O allowed) are also important but more easily enforced (e.g. AssertIOAllowed()) and we are thus fine keeping the compile-time enforcement to the execution mode only. This, in general, doesn't change the desire to have components get their own TaskRunner instead of having it passed in in the TaskScheduler world. BUG=553459 Committed: https://crrev.com/e72adfa10a4c8c04c47b3004f73b8f694d82fcbf Cr-Commit-Position: refs/heads/master@{#429276}

Patch Set 1 #

Patch Set 2 : self-review #

Total comments: 25

Patch Set 3 : CR gab #4 #

Patch Set 4 : CR robliao #10 #

Total comments: 5

Patch Set 5 : CR danakj #17 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+259 lines, -160 lines) Patch
M base/BUILD.gn View 1 chunk +1 line, -0 lines 0 comments Download
M base/task_scheduler/delayed_task_manager_unittest.cc View 1 2 2 chunks +19 lines, -6 lines 0 comments Download
M base/task_scheduler/post_task.h View 1 2 3 chunks +28 lines, -10 lines 0 comments Download
M base/task_scheduler/post_task.cc View 1 chunk +14 lines, -5 lines 0 comments Download
M base/task_scheduler/scheduler_worker.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M base/task_scheduler/scheduler_worker_pool.h View 1 2 chunks +18 lines, -4 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool_impl.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool_impl.cc View 1 2 2 chunks +23 lines, -26 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool_impl_unittest.cc View 17 chunks +47 lines, -35 lines 0 comments Download
M base/task_scheduler/task_scheduler.h View 1 2 chunks +16 lines, -4 lines 0 comments Download
M base/task_scheduler/task_scheduler_impl.h View 1 2 2 chunks +5 lines, -3 lines 0 comments Download
M base/task_scheduler/task_scheduler_impl.cc View 1 chunk +16 lines, -4 lines 0 comments Download
M base/task_scheduler/task_scheduler_impl_unittest.cc View 4 chunks +28 lines, -10 lines 0 comments Download
M base/task_scheduler/task_tracker.cc View 1 2 4 chunks +12 lines, -9 lines 0 comments Download
M base/task_scheduler/task_traits.h View 2 chunks +0 lines, -16 lines 0 comments Download
M base/task_scheduler/task_traits.cc View 2 chunks +0 lines, -19 lines 0 comments Download
M base/task_scheduler/test_task_factory.h View 1 chunk +1 line, -0 lines 0 comments Download
A base/task_scheduler/test_utils.h View 1 2 3 4 1 chunk +20 lines, -0 lines 0 comments Download
M base/threading/sequenced_worker_pool.cc View 2 chunks +4 lines, -5 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 33 (13 generated)
fdoray
PTAL
4 years, 1 month ago (2016-10-31 18:15:33 UTC) #2
gab
Add to CL description something like: We had originally explicitly opted against providing typed TaskRunners ...
4 years, 1 month ago (2016-10-31 18:52:55 UTC) #3
gab
lgtm % comments https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/delayed_task_manager_unittest.cc File base/task_scheduler/delayed_task_manager_unittest.cc (right): https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/delayed_task_manager_unittest.cc#newcode13 base/task_scheduler/delayed_task_manager_unittest.cc:13: #include "base/single_thread_task_runner.h" Was previously missing task_runner.h ...
4 years, 1 month ago (2016-10-31 19:10:11 UTC) #4
robliao
https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker.cc File base/task_scheduler/scheduler_worker.cc (right): https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker.cc#newcode50 base/task_scheduler/scheduler_worker.cc:50: // CoInitialized environment to request one (via an upcoming ...
4 years, 1 month ago (2016-10-31 19:19:59 UTC) #5
gab
https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker_pool_impl.cc File base/task_scheduler/scheduler_worker_pool_impl.cc (left): https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker_pool_impl.cc#oldcode20 base/task_scheduler/scheduler_worker_pool_impl.cc:20: #include "base/single_thread_task_runner.h" On 2016/10/31 19:19:59, robliao wrote: > On ...
4 years, 1 month ago (2016-10-31 19:28:45 UTC) #6
robliao
https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker_pool_impl.cc File base/task_scheduler/scheduler_worker_pool_impl.cc (left): https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker_pool_impl.cc#oldcode20 base/task_scheduler/scheduler_worker_pool_impl.cc:20: #include "base/single_thread_task_runner.h" On 2016/10/31 19:28:45, gab wrote: > On ...
4 years, 1 month ago (2016-10-31 19:31:48 UTC) #7
fdoray
robliao@: PTAL https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/delayed_task_manager_unittest.cc File base/task_scheduler/delayed_task_manager_unittest.cc (right): https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/delayed_task_manager_unittest.cc#newcode13 base/task_scheduler/delayed_task_manager_unittest.cc:13: #include "base/single_thread_task_runner.h" On 2016/10/31 19:10:11, gab wrote: ...
4 years, 1 month ago (2016-10-31 19:44:52 UTC) #9
robliao
https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker.cc File base/task_scheduler/scheduler_worker.cc (right): https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker.cc#newcode50 base/task_scheduler/scheduler_worker.cc:50: // CoInitialized environment to request one (via an upcoming ...
4 years, 1 month ago (2016-10-31 19:50:46 UTC) #10
fdoray
robliao@: PTAnL https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker.cc File base/task_scheduler/scheduler_worker.cc (right): https://codereview.chromium.org/2464963002/diff/20001/base/task_scheduler/scheduler_worker.cc#newcode50 base/task_scheduler/scheduler_worker.cc:50: // CoInitialized environment to request one (via ...
4 years, 1 month ago (2016-10-31 20:42:28 UTC) #11
robliao
lgtm! Thanks. One of COM calls do exist as well as COM calls that could ...
4 years, 1 month ago (2016-11-01 00:33:21 UTC) #12
fdoray
danakj@: PTAL
4 years, 1 month ago (2016-11-01 12:21:10 UTC) #16
danakj
LGTM I like https://codereview.chromium.org/2464963002/diff/60001/base/task_scheduler/task_tracker.cc File base/task_scheduler/task_tracker.cc (right): https://codereview.chromium.org/2464963002/diff/60001/base/task_scheduler/task_tracker.cc#newcode28 base/task_scheduler/task_tracker.cc:28: constexpr char kParallelExecutionMode[] = "parallel"; style ...
4 years, 1 month ago (2016-11-01 20:32:11 UTC) #17
fdoray
https://codereview.chromium.org/2464963002/diff/60001/base/task_scheduler/task_tracker.cc File base/task_scheduler/task_tracker.cc (right): https://codereview.chromium.org/2464963002/diff/60001/base/task_scheduler/task_tracker.cc#newcode28 base/task_scheduler/task_tracker.cc:28: constexpr char kParallelExecutionMode[] = "parallel"; On 2016/11/01 20:32:11, danakj ...
4 years, 1 month ago (2016-11-01 20:45:44 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2464963002/80001
4 years, 1 month ago (2016-11-01 20:46:21 UTC) #21
danakj
https://codereview.chromium.org/2464963002/diff/60001/base/task_scheduler/task_tracker.cc File base/task_scheduler/task_tracker.cc (right): https://codereview.chromium.org/2464963002/diff/60001/base/task_scheduler/task_tracker.cc#newcode28 base/task_scheduler/task_tracker.cc:28: constexpr char kParallelExecutionMode[] = "parallel"; On 2016/11/01 20:45:44, fdoray ...
4 years, 1 month ago (2016-11-01 21:53:32 UTC) #22
commit-bot: I haz the power
Try jobs failed on following builders: chromeos_x86-generic_chromium_compile_only_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/chromeos_x86-generic_chromium_compile_only_ng/builds/227293) linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, ...
4 years, 1 month ago (2016-11-01 22:47:53 UTC) #24
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2464963002/80001
4 years, 1 month ago (2016-11-02 12:35:01 UTC) #26
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2464963002/80001
4 years, 1 month ago (2016-11-02 12:36:19 UTC) #29
commit-bot: I haz the power
Committed patchset #5 (id:80001)
4 years, 1 month ago (2016-11-02 14:35:50 UTC) #31
commit-bot: I haz the power
4 years, 1 month ago (2016-11-02 14:38:14 UTC) #33
Message was sent while issue was closed.
Patchset 5 (id:??) landed as
https://crrev.com/e72adfa10a4c8c04c47b3004f73b8f694d82fcbf
Cr-Commit-Position: refs/heads/master@{#429276}

Powered by Google App Engine
This is Rietveld 408576698