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

Issue 9845037: Add SequencedWorkerPool.IsRunningSequenceOnCurrentThread so callers can make stronger assertions ab… (Closed)

Created:
8 years, 9 months ago by michaeln
Modified:
8 years, 8 months ago
Reviewers:
brettw, akalin
CC:
chromium-reviews, brettw-cc_chromium.org
Visibility:
Public.

Description

Add SequencedWorkerPool.IsRunningSequenceOnCurrentThread so callers can make stronger assertions about where methods are being called. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=129979

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : #

Total comments: 1

Patch Set 4 : #

Patch Set 5 : #

Patch Set 6 : #

Patch Set 7 : #

Total comments: 1

Patch Set 8 : #

Patch Set 9 : #

Total comments: 6

Patch Set 10 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+86 lines, -0 lines) Patch
M base/threading/sequenced_worker_pool.h View 1 2 3 4 5 6 7 1 chunk +4 lines, -0 lines 0 comments Download
M base/threading/sequenced_worker_pool.cc View 1 2 3 4 5 6 7 8 5 chunks +30 lines, -0 lines 0 comments Download
M base/threading/sequenced_worker_pool_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +52 lines, -0 lines 0 comments Download

Messages

Total messages: 19 (0 generated)
michaeln
https://chromiumcodereview.appspot.com/9845037/diff/6003/base/threading/sequenced_worker_pool_unittest.cc File base/threading/sequenced_worker_pool_unittest.cc (right): https://chromiumcodereview.appspot.com/9845037/diff/6003/base/threading/sequenced_worker_pool_unittest.cc#newcode513 base/threading/sequenced_worker_pool_unittest.cc:513: // TODO(michaeln): write a test for IsRunningSequenceOnCurrentThread i'll add ...
8 years, 9 months ago (2012-03-23 21:32:37 UTC) #1
michaeln
when ahead and added the test
8 years, 9 months ago (2012-03-24 01:05:41 UTC) #2
michaeln
Updated to function properly given multiple pools in the same process (updated tests too), and ...
8 years, 9 months ago (2012-03-25 00:16:20 UTC) #3
michaeln
https://chromiumcodereview.appspot.com/9845037/diff/3008/base/threading/sequenced_worker_pool.cc File base/threading/sequenced_worker_pool.cc (right): https://chromiumcodereview.appspot.com/9845037/diff/3008/base/threading/sequenced_worker_pool.cc#newcode382 base/threading/sequenced_worker_pool.cc:382: bool SequencedWorkerPool::Inner::RunsTasksOnCurrentThread() const { we could hoist these method ...
8 years, 9 months ago (2012-03-25 00:20:01 UTC) #4
michaeln
adding akalin on the review list too since he's done a bunch of work on ...
8 years, 9 months ago (2012-03-25 01:03:52 UTC) #5
akalin
On 2012/03/25 01:03:52, michaeln wrote: > adding akalin on the review list too since he's ...
8 years, 9 months ago (2012-03-26 04:28:49 UTC) #6
michaeln
TaskRunner is a nice interface, but the SWP class also stands on its own... i ...
8 years, 9 months ago (2012-03-26 18:50:56 UTC) #7
michaeln
If we go with TLS usage for this, i think the threads_ collection could be ...
8 years, 9 months ago (2012-03-27 01:46:26 UTC) #8
akalin
On 2012/03/27 01:46:26, michaeln wrote: > If we go with TLS usage for this, i ...
8 years, 9 months ago (2012-03-27 04:07:27 UTC) #9
michaeln
> Yeah, but the TLS usage is precisely what I want to avoid. :-) I ...
8 years, 9 months ago (2012-03-27 04:29:00 UTC) #10
akalin
On 2012/03/27 04:29:00, michaeln wrote: > Certainly could go back to looking up by tid, ...
8 years, 9 months ago (2012-03-27 05:37:02 UTC) #11
michaeln
The ratio of usage aside, in absolute terms there are a lot of callsites. There ...
8 years, 9 months ago (2012-03-27 20:11:13 UTC) #12
akalin
On 2012/03/27 20:11:13, michaeln wrote: > Below are the number of tasks run in a ...
8 years, 9 months ago (2012-03-27 20:30:19 UTC) #13
michaeln
> To make forward progress, why don't you move this review over to brett? (I'm ...
8 years, 9 months ago (2012-03-27 21:26:47 UTC) #14
michaeln
switched to lock + map
8 years, 9 months ago (2012-03-27 22:16:40 UTC) #15
michaeln
ping
8 years, 9 months ago (2012-03-28 19:01:40 UTC) #16
akalin
LGTM after nits, thanks http://codereview.chromium.org/9845037/diff/22001/base/threading/sequenced_worker_pool_unittest.cc File base/threading/sequenced_worker_pool_unittest.cc (right): http://codereview.chromium.org/9845037/diff/22001/base/threading/sequenced_worker_pool_unittest.cc#newcode513 base/threading/sequenced_worker_pool_unittest.cc:513: static void IsRunningOnCurrentThreadTask( nit: no ...
8 years, 9 months ago (2012-03-28 20:24:09 UTC) #17
brettw
LGTM rubberstamp based on Fred's review.
8 years, 9 months ago (2012-03-28 20:26:37 UTC) #18
michaeln
8 years, 8 months ago (2012-03-30 22:35:28 UTC) #19
https://chromiumcodereview.appspot.com/9845037/diff/22001/base/threading/sequ...
File base/threading/sequenced_worker_pool_unittest.cc (right):

https://chromiumcodereview.appspot.com/9845037/diff/22001/base/threading/sequ...
base/threading/sequenced_worker_pool_unittest.cc:513: static void
IsRunningOnCurrentThreadTask(
On 2012/03/28 20:24:09, akalin wrote:
> nit: no static needed since you're already in anon namespace

Done.

https://chromiumcodereview.appspot.com/9845037/diff/22001/base/threading/sequ...
base/threading/sequenced_worker_pool_unittest.cc:516: SequencedWorkerPool* pool,
On 2012/03/28 20:24:09, akalin wrote:
> any particular reason this takes a raw pointer instead of a refptr?  if not,
I'd
> prefer the scoped_refptr

I updated the base::Bind callsites to not use Unretained(), more readable. Also
now the closure's internal storage constains scoped_refptr<>s to these guys to
ensure these ptrs are valid. Passing scoped_refptr<> by value serves no purpose
at runtime (just churns the refcount), passing const scoped_repftr<>& is
somewhat confusing (what's const exactly), and both decrease readability.

https://chromiumcodereview.appspot.com/9845037/diff/22001/base/threading/sequ...
base/threading/sequenced_worker_pool_unittest.cc:528:
TEST_F(SequencedWorkerPoolTest, IsRunningOnCurrentThread) {
On 2012/03/28 20:24:09, akalin wrote:
> add test-level comment explaining what the test is doing

Done.

Powered by Google App Engine
This is Rietveld 408576698