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

Issue 2213263002: Make ThreadChecker::CalledOnValidThread() return true when called from the same task. (Closed)

Created:
4 years, 4 months ago by fdoray
Modified:
4 years, 4 months ago
Reviewers:
robliao, Lei Zhang, gab
CC:
chromium-reviews, gab+watch_chromium.org, robliao+watch_chromium.org, fdoray+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make ThreadChecker::CalledOnValidThread() return true when called from the same task. This CL introduces TaskToken to identify individual tasks. In the scope of a ScopedSetSequenceTokenForCurrentThread, a unique TaskToken is set in TLS. This unique TaskToken can be retrieved using TaskToken::GetForCurrentThread(). ThreadCheckerImpl uses TaskToken to make CalledOnValidThread() return true when called multiple times from the same task. This allows usage of ThreadChecker/NonThreadSafe objects from the stack on tasks not otherwise running in a single-threaded context. BUG=553459 Committed: https://crrev.com/b339954beda5b00c4a482d74594cbe2e7cd39516 Cr-Commit-Position: refs/heads/master@{#410839}

Patch Set 1 #

Patch Set 2 : add missing files #

Patch Set 3 : similarity #

Total comments: 18

Patch Set 4 : CR gab #4 #

Patch Set 5 : self-review #

Patch Set 6 : self-review #

Total comments: 2

Patch Set 7 : CR gab #6 (fix comment) #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+203 lines, -27 lines) Patch
D base/sequence_token.h View 1 2 3 4 5 6 1 chunk +52 lines, -6 lines 2 comments Download
D base/sequence_token.cc View 1 2 3 4 2 chunks +37 lines, -8 lines 2 comments Download
D base/sequence_token_unittest.cc View 1 2 3 4 1 chunk +60 lines, -0 lines 0 comments Download
M base/threading/thread_checker.h View 1 chunk +1 line, -3 lines 0 comments Download
M base/threading/thread_checker_impl.h View 1 2 3 1 chunk +8 lines, -0 lines 0 comments Download
M base/threading/thread_checker_impl.cc View 3 chunks +7 lines, -0 lines 0 comments Download
M base/threading/thread_checker_unittest.cc View 1 2 3 3 chunks +38 lines, -10 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 29 (12 generated)
fdoray
PTAL
4 years, 4 months ago (2016-08-04 22:28:51 UTC) #2
fdoray
Forgot to add some files...
4 years, 4 months ago (2016-08-05 18:45:15 UTC) #3
gab
lg, mostly nits (and request about maybe not renaming everything?) https://codereview.chromium.org/2213263002/diff/40001/base/sequence_and_task_token.h File base/sequence_and_task_token.h (right): https://codereview.chromium.org/2213263002/diff/40001/base/sequence_and_task_token.h#newcode5 ...
4 years, 4 months ago (2016-08-08 16:34:23 UTC) #4
fdoray
gab@: PTAnL https://codereview.chromium.org/2213263002/diff/40001/base/sequence_and_task_token.h File base/sequence_and_task_token.h (right): https://codereview.chromium.org/2213263002/diff/40001/base/sequence_and_task_token.h#newcode5 base/sequence_and_task_token.h:5: #ifndef BASE_SEQUENCE_AND_TASK_TOKEN_H_ On 2016/08/08 16:34:22, gab wrote: ...
4 years, 4 months ago (2016-08-08 17:45:18 UTC) #5
gab
Add to CL description that this allows usage of ThreadChecker/NonThreadSafe objects from the stack on ...
4 years, 4 months ago (2016-08-08 17:56:36 UTC) #6
fdoray
thestig@: PTAL https://codereview.chromium.org/2213263002/diff/100001/base/sequence_token.h File base/sequence_token.h (right): https://codereview.chromium.org/2213263002/diff/100001/base/sequence_token.h#newcode84 base/sequence_token.h:84: // a ScopedSetSequenceTokenForCurrentThread is instantiated. On 2016/08/08 ...
4 years, 4 months ago (2016-08-08 18:11:35 UTC) #10
Lei Zhang
Looking... Strangely, sequence_token* are marked as 'D' rather than 'M'.
4 years, 4 months ago (2016-08-08 22:36:38 UTC) #11
fdoray
On 2016/08/08 22:36:38, Lei Zhang wrote: > Looking... Strangely, sequence_token* are marked as 'D' rather ...
4 years, 4 months ago (2016-08-08 22:39:17 UTC) #12
Lei Zhang
lgtm https://codereview.chromium.org/2213263002/diff/120001/base/sequence_token.cc File base/sequence_token.cc (right): https://codereview.chromium.org/2213263002/diff/120001/base/sequence_token.cc#newcode51 base/sequence_token.cc:51: return token_ == other.token_ && token_ != kInvalidTaskToken; ...
4 years, 4 months ago (2016-08-08 23:21:26 UTC) #13
gab
Thanks Lei, nits addressed in https://codereview.chromium.org/2228993003/ so I can land this as-is under fdoray's authorship ...
4 years, 4 months ago (2016-08-09 15:50:15 UTC) #14
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/2213263002/120001
4 years, 4 months ago (2016-08-09 15:50:52 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_asan_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_asan_rel_ng/builds/206546)
4 years, 4 months ago (2016-08-09 17:52:03 UTC) #19
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/2213263002/120001
4 years, 4 months ago (2016-08-09 17:57:14 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: linux_android_rel_ng on master.tryserver.chromium.android (JOB_FAILED, https://build.chromium.org/p/tryserver.chromium.android/builders/linux_android_rel_ng/builds/118891)
4 years, 4 months ago (2016-08-09 20:20:01 UTC) #23
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/2213263002/120001
4 years, 4 months ago (2016-08-09 20:29:17 UTC) #25
commit-bot: I haz the power
Committed patchset #7 (id:120001)
4 years, 4 months ago (2016-08-09 21:50:09 UTC) #27
commit-bot: I haz the power
4 years, 4 months ago (2016-08-09 21:52:09 UTC) #29
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/b339954beda5b00c4a482d74594cbe2e7cd39516
Cr-Commit-Position: refs/heads/master@{#410839}

Powered by Google App Engine
This is Rietveld 408576698