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

Issue 2721553003: Remove SingleThreadTaskRunner Support from SchedulerWorkerPoolImpl (Closed)

Created:
3 years, 9 months ago by robliao
Modified:
3 years, 9 months ago
Reviewers:
fdoray, gab
CC:
chromium-reviews, gab+watch_chromium.org, robliao+watch_chromium.org, fdoray+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Remove SingleThreadTaskRunner Support from SchedulerWorkerPoolImpl With SchedulerSingleThreadTaskRunnerManager, SchedulerWorkerPoolImpl no longer needs to handle SingleThreadTaskRunners. BUG=694823 Review-Url: https://codereview.chromium.org/2721553003 Cr-Commit-Position: refs/heads/master@{#457124} Committed: https://chromium.googlesource.com/chromium/src/+/94b6750c5377b3e4079ea0d74fbbb0e8912df346

Patch Set 1 #

Total comments: 7

Patch Set 2 : CR Feedback #

Patch Set 3 : Rebase to 08266b3 #

Total comments: 13
Unified diffs Side-by-side diffs Delta from patch set Stats (+37 lines, -386 lines) Patch
M base/task_scheduler/priority_queue.h View 1 chunk +0 lines, -5 lines 0 comments Download
M base/task_scheduler/priority_queue.cc View 1 chunk +0 lines, -5 lines 0 comments Download
M base/task_scheduler/priority_queue_unittest.cc View 1 chunk +0 lines, -13 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool.h View 1 4 chunks +6 lines, -22 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool_impl.h View 4 chunks +2 lines, -17 lines 0 comments Download
M base/task_scheduler/scheduler_worker_pool_impl.cc View 17 chunks +24 lines, -198 lines 11 comments Download
M base/task_scheduler/scheduler_worker_pool_impl_unittest.cc View 1 2 2 chunks +4 lines, -125 lines 2 comments Download
M base/task_scheduler/task_scheduler_impl.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 32 (21 generated)
robliao
3 years, 9 months ago (2017-03-13 23:46:59 UTC) #9
fdoray
https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool.h File base/task_scheduler/scheduler_worker_pool.h (right): https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool.h#newcode13 base/task_scheduler/scheduler_worker_pool.h:13: #include "base/single_thread_task_runner.h" No longer needed. https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc File base/task_scheduler/scheduler_worker_pool_impl_unittest.cc (right): ...
3 years, 9 months ago (2017-03-14 18:35:47 UTC) #12
robliao
https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool.h File base/task_scheduler/scheduler_worker_pool.h (right): https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool.h#newcode13 base/task_scheduler/scheduler_worker_pool.h:13: #include "base/single_thread_task_runner.h" On 2017/03/14 18:35:47, fdoray wrote: > No ...
3 years, 9 months ago (2017-03-14 22:58:28 UTC) #13
fdoray
lgtm
3 years, 9 months ago (2017-03-15 14:20:22 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/2721553003/60001
3 years, 9 months ago (2017-03-15 17:33:19 UTC) #24
commit-bot: I haz the power
Committed patchset #3 (id:60001) as https://chromium.googlesource.com/chromium/src/+/94b6750c5377b3e4079ea0d74fbbb0e8912df346
3 years, 9 months ago (2017-03-15 17:41:32 UTC) #27
gab
Woot, lgtm w/ comments + I think we can get rid of Sequence::Transaction as a ...
3 years, 9 months ago (2017-03-15 20:20:58 UTC) #28
robliao
> I think we can get rid of Sequence::Transaction as a follow-up! Yes. This CL ...
3 years, 9 months ago (2017-03-15 20:46:44 UTC) #29
gab
https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc File base/task_scheduler/scheduler_worker_pool_impl_unittest.cc (right): https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc#newcode124 base/task_scheduler/scheduler_worker_pool_impl_unittest.cc:124: default: On 2017/03/14 22:58:28, robliao wrote: > On 2017/03/14 ...
3 years, 9 months ago (2017-03-16 15:34:46 UTC) #30
robliao
https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc File base/task_scheduler/scheduler_worker_pool_impl_unittest.cc (right): https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/scheduler_worker_pool_impl_unittest.cc#newcode124 base/task_scheduler/scheduler_worker_pool_impl_unittest.cc:124: default: On 2017/03/16 15:34:45, gab wrote: > On 2017/03/14 ...
3 years, 9 months ago (2017-03-16 22:49:03 UTC) #31
gab
3 years, 9 months ago (2017-03-20 16:40:58 UTC) #32
Message was sent while issue was closed.
https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/sch...
File base/task_scheduler/scheduler_worker_pool_impl_unittest.cc (right):

https://codereview.chromium.org/2721553003/diff/20001/base/task_scheduler/sch...
base/task_scheduler/scheduler_worker_pool_impl_unittest.cc:124: default:
On 2017/03/16 22:49:03, robliao wrote:
> On 2017/03/16 15:34:45, gab wrote:
> > On 2017/03/14 22:58:28, robliao wrote:
> > > On 2017/03/14 18:35:47, fdoray wrote:
> > > > If you have no default and you forget to handle an enum value, clang
> > > complains.
> > > > E.g.:
> > > > error: enumeration value 'SEQUENCED' not handled in switch
> > [-Werror,-Wswitch]
> > > > 
> > > > I would not add a default to make sure that we are warned at compile
time
> if
> > > we
> > > > forget to handle a value.
> > > 
> > > Indeed. I would agree if the goal here is to be exhaustive. Now that we're
> no
> > > longer handling the SINGLE_THREADED execution mode, it's likely we won't
> > handle
> > > others (e.g. the COM execution mode if there is one).
> > > 
> > > Since it's not clear this should be an exhaustive enumeration anymore, and
> > > having clang complain just because we added an enumeration value seems to
be
> > > noisy.
> > > 
> > > As a general practice, all new code is generally associated with tests, so
> > it's
> > > unlikely we would miss this when adding a new task runner to
> > > SchedulerWorkerPoolImpl.
> > > 
> > > Happy to add it back if you feel strongly about it.
> > 
> > In that case we can keep default but we should still NOTREACHED if it's
called
> > with an unhandled case
> 
> That suggests we should be using NOTREACHED() at the bottom instead of
> ADD_FAILURE(). Thoughts?

Ah, had missed this was in a unittest. ADD_FAILURE() is preferred to
NOTREACHED() then. But I'd prefer to move both the ADD_FAILURE() and return
nullptr to the default: case (I think that will compile and not complain about
missing return statement?)

https://codereview.chromium.org/2721553003/diff/60001/base/task_scheduler/sch...
File base/task_scheduler/scheduler_worker_pool_impl.cc (right):

https://codereview.chromium.org/2721553003/diff/60001/base/task_scheduler/sch...
base/task_scheduler/scheduler_worker_pool_impl.cc:396:
outer_->shared_priority_queue_.BeginTransaction());
On 2017/03/16 22:49:03, robliao wrote:
> On 2017/03/16 15:34:45, gab (offsite.. back Monday) wrote:
> > On 2017/03/15 20:46:44, robliao wrote:
> > > On 2017/03/15 20:20:58, gab wrote:
> > > > This was the only use case of transaction I believe. We can now
atomically
> > > > attempt to pop and do something if it came out empty.
> > > > 
> > > > Let's do this in a follow-up CL? (it will also be easier to bring it
back
> if
> > > > it's needed later if it was stripped in its own CL)
> > > > 
> > > > Add TODO here for now.
> > > 
> > > Correct. This is focused on just SchedulerWorkerPoolImpl. Since there's a
> bug
> > > covering this, that's better covered there.
> > 
> > Unless you have a CL doing this now I still prefer a TODO, it's better for
> > readability (people will read the code, not the bug list). A TODO referring
to
> > the bug is the best way to connect the two.
> 
> In progress at the moment!

Ok but for future reference a comment in code referring to bug is always
preferable :).

Powered by Google App Engine
This is Rietveld 408576698