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

Issue 1207823004: PlatformThreadHandle: remove public id() interface (Closed)

Created:
5 years, 6 months ago by Takashi Toyoshima
Modified:
5 years, 5 months ago
Reviewers:
Lei Zhang, kinuko, gab, jam
CC:
chromium-reviews, mlamouri+watch-content_chromium.org, darin-cc_chromium.org, mkwst+moarreviews-renderer_chromium.org, piman+watch_chromium.org, erikwright+watch_chromium.org, Nico
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PlatformThreadHandle: remove public id() interface Remove PlatformThreadHandle.id() interface. Also remove id_ member that is not needed any more. BUG=468793 TEST=./out/Debug/base_unittests TEST=git cl try Committed: https://crrev.com/c41261e9491c3a763c472fe35737ec36200d6310 Cr-Commit-Position: refs/heads/master@{#340242}

Patch Set 1 : for try (complete set including a CL that is not landed yet) #

Patch Set 2 : (rebase to show diff from 1193303002) #

Total comments: 2

Patch Set 3 : (upstream master for try) #

Patch Set 4 : (upstream 1193303002 for review) #

Total comments: 12

Patch Set 5 : (upstream master for try) #

Total comments: 2

Patch Set 6 : review #14, #16 (upstream 1193303002 for review) #

Total comments: 7

Patch Set 7 : [rebase] #

Patch Set 8 : review #21 #

Patch Set 9 : one more simplification #

Patch Set 10 : [rebase and try] #

Total comments: 5

Patch Set 11 : thread_id is safe to call, and thread can restart #

Patch Set 12 : keep thread_id after Stop() #

Total comments: 4

Patch Set 13 : minimum change to remove id #

Patch Set 14 : more comments #

Total comments: 8

Patch Set 15 : fix nits and add test code to check race #

Patch Set 16 : return 0 instead of NULL for DWORD, and "git cl format" #

Patch Set 17 : thread_id() -> GetThreadId() #

Total comments: 4

Patch Set 18 : the last two nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -66 lines) Patch
M base/threading/platform_thread.h View 1 2 3 5 2 chunks +2 lines, -20 lines 0 comments Download
M base/threading/platform_thread_posix.cc View 1 2 3 5 2 chunks +2 lines, -3 lines 0 comments Download
M base/threading/platform_thread_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 4 chunks +9 lines, -10 lines 0 comments Download
M base/threading/thread.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 3 chunks +14 lines, -5 lines 0 comments Download
M base/threading/thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 6 chunks +18 lines, -8 lines 0 comments Download
M base/threading/thread_id_name_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +6 lines, -6 lines 0 comments Download
M base/threading/thread_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 3 chunks +51 lines, -0 lines 0 comments Download
M base/trace_event/trace_event_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M components/scheduler/child/webthread_impl_for_worker_scheduler.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M content/browser/browser_main_loop.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/power_save_blocker_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download
M content/gpu/gpu_watchdog_thread.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download
M gpu/command_buffer/service/gpu_tracer.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download
M media/midi/midi_manager_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 2 chunks +2 lines, -2 lines 0 comments Download
M sandbox/linux/services/thread_helpers.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M win8/test/open_with_dialog_async.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 66 (16 generated)
Takashi Toyoshima
gab@, Can you take a look? This is a CL to remove id() from PlatformThread ...
5 years, 5 months ago (2015-06-30 03:42:39 UTC) #8
Takashi Toyoshima
video_renderer_impl.cc was fixed in a separate CL, https://codereview.chromium.org/1217943003/ and already landed :)
5 years, 5 months ago (2015-06-30 11:27:19 UTC) #9
gab
https://codereview.chromium.org/1207823004/diff/140001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/1207823004/diff/140001/base/threading/platform_thread.h#newcode91 base/threading/platform_thread.h:91: friend class ThreadIdNameManager; I don't like using friend and ...
5 years, 5 months ago (2015-06-30 13:57:35 UTC) #10
Takashi Toyoshima
PTAL Patch Set 4. https://codereview.chromium.org/1207823004/diff/140001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/1207823004/diff/140001/base/threading/platform_thread.h#newcode91 base/threading/platform_thread.h:91: friend class ThreadIdNameManager; OK, let ...
5 years, 5 months ago (2015-07-02 06:34:28 UTC) #13
gab
https://codereview.chromium.org/1207823004/diff/210001/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (left): https://codereview.chromium.org/1207823004/diff/210001/base/threading/platform_thread_posix.cc#oldcode67 base/threading/platform_thread_posix.cc:67: PlatformThread::CurrentId()); Need to fix platform_thread_win.cc similarly. https://codereview.chromium.org/1207823004/diff/210001/base/threading/thread.cc File base/threading/thread.cc ...
5 years, 5 months ago (2015-07-02 12:00:52 UTC) #14
Takashi Toyoshima
https://codereview.chromium.org/1207823004/diff/210001/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (left): https://codereview.chromium.org/1207823004/diff/210001/base/threading/platform_thread_posix.cc#oldcode67 base/threading/platform_thread_posix.cc:67: PlatformThread::CurrentId()); I may misunderstand your comment, but I think ...
5 years, 5 months ago (2015-07-02 13:54:58 UTC) #15
gab
https://codereview.chromium.org/1207823004/diff/210001/base/threading/platform_thread_posix.cc File base/threading/platform_thread_posix.cc (left): https://codereview.chromium.org/1207823004/diff/210001/base/threading/platform_thread_posix.cc#oldcode67 base/threading/platform_thread_posix.cc:67: PlatformThread::CurrentId()); On 2015/07/02 13:54:58, Takashi Toyoshima (chromium) wrote: > ...
5 years, 5 months ago (2015-07-02 14:32:34 UTC) #16
Takashi Toyoshima
Added a test and defensive CHECK in thread_id(). Let me see the try results. https://codereview.chromium.org/1207823004/diff/210001/base/threading/platform_thread_posix.cc ...
5 years, 5 months ago (2015-07-03 04:22:56 UTC) #17
gab
Looks like some kind of rebase is required, the diff includes unexpected changes. https://codereview.chromium.org/1207823004/diff/210001/base/threading/thread.h File ...
5 years, 5 months ago (2015-07-08 18:35:21 UTC) #18
Takashi Toyoshima
https://codereview.chromium.org/1207823004/diff/230001/base/threading/platform_thread.h File base/threading/platform_thread.h (right): https://codereview.chromium.org/1207823004/diff/230001/base/threading/platform_thread.h#newcode183 base/threading/platform_thread.h:183: static void SetCurrentThreadPriority(ThreadPriority priority); This patch set 5 contains ...
5 years, 5 months ago (2015-07-09 03:39:22 UTC) #19
gab
On 2015/07/09 03:39:22, Takashi Toyoshima (chromium) wrote: > https://codereview.chromium.org/1207823004/diff/230001/base/threading/platform_thread.h > File base/threading/platform_thread.h (right): > > ...
5 years, 5 months ago (2015-07-09 18:10:19 UTC) #20
gab
lg, a few comments below https://codereview.chromium.org/1207823004/diff/250001/base/threading/thread.cc File base/threading/thread.cc (right): https://codereview.chromium.org/1207823004/diff/250001/base/threading/thread.cc#newcode181 base/threading/thread.cc:181: CHECK_NE(kInvalidThreadId, id_); Is this ...
5 years, 5 months ago (2015-07-09 18:19:00 UTC) #21
Takashi Toyoshima
+thestig@, thakis@ since they review a CL on which this change depends.
5 years, 5 months ago (2015-07-14 08:05:54 UTC) #23
Takashi Toyoshima
https://codereview.chromium.org/1207823004/diff/250001/base/threading/thread.cc File base/threading/thread.cc (right): https://codereview.chromium.org/1207823004/diff/250001/base/threading/thread.cc#newcode181 base/threading/thread.cc:181: CHECK_NE(kInvalidThreadId, id_); I see, DCHECK_NE looks better here. https://codereview.chromium.org/1207823004/diff/250001/base/threading/thread.h ...
5 years, 5 months ago (2015-07-14 10:47:29 UTC) #24
Takashi Toyoshima
Hum..., some tests look broken somewhere after the patch set 3. I'll ping again once ...
5 years, 5 months ago (2015-07-14 14:08:27 UTC) #25
kinuko
Drive-by. https://codereview.chromium.org/1207823004/diff/330001/base/threading/thread.cc File base/threading/thread.cc (right): https://codereview.chromium.org/1207823004/diff/330001/base/threading/thread.cc#newcode173 base/threading/thread.cc:173: DCHECK_NE(kInvalidThreadId, id_); Assume that we could fix all ...
5 years, 5 months ago (2015-07-16 00:50:37 UTC) #27
Takashi Toyoshima
https://codereview.chromium.org/1207823004/diff/330001/base/threading/thread.cc File base/threading/thread.cc (right): https://codereview.chromium.org/1207823004/diff/330001/base/threading/thread.cc#newcode173 base/threading/thread.cc:173: DCHECK_NE(kInvalidThreadId, id_); Thanks. I'm doing trial and error here ...
5 years, 5 months ago (2015-07-16 05:07:31 UTC) #28
kinuko
On 2015/07/16 05:07:31, Takashi Toyoshima (chromium) wrote: > https://codereview.chromium.org/1207823004/diff/330001/base/threading/thread.cc > File base/threading/thread.cc (right): > > ...
5 years, 5 months ago (2015-07-16 06:01:05 UTC) #29
Takashi Toyoshima
PTAL Patch Set 11. I find another problem of my CL. Thread seems to support ...
5 years, 5 months ago (2015-07-16 08:12:38 UTC) #30
Takashi Toyoshima
undo PTAL :(
5 years, 5 months ago (2015-07-16 10:55:57 UTC) #31
gab
Seems this CL is now doing a lot more than removing id() from the interface. ...
5 years, 5 months ago (2015-07-16 17:19:34 UTC) #32
gab
https://codereview.chromium.org/1207823004/diff/250001/base/threading/thread.h File base/threading/thread.h (right): https://codereview.chromium.org/1207823004/diff/250001/base/threading/thread.h#newcode227 base/threading/thread.h:227: mutable base::Lock id_lock_; // Protects |id_|. On 2015/07/14 10:47:28, ...
5 years, 5 months ago (2015-07-16 17:28:24 UTC) #33
Takashi Toyoshima
Hum... I do not think this contains unrelated changes, and everything are needed to make ...
5 years, 5 months ago (2015-07-16 19:51:11 UTC) #34
Takashi Toyoshima
PTAL Patch Set 14. https://codereview.chromium.org/1207823004/diff/410001/base/threading/thread.h File base/threading/thread.h (right): https://codereview.chromium.org/1207823004/diff/410001/base/threading/thread.h#newcode174 base/threading/thread.h:174: // call. Keeps on returning ...
5 years, 5 months ago (2015-07-17 13:20:22 UTC) #35
gab
lgtm but I think a Lock would be simpler than a WaitableEvent (which itself has ...
5 years, 5 months ago (2015-07-17 20:12:25 UTC) #36
Takashi Toyoshima
We can not use a Lock here because the lock period starts and ends on ...
5 years, 5 months ago (2015-07-18 07:06:51 UTC) #37
Takashi Toyoshima
Lei, can you take a look for OWNERS approval?
5 years, 5 months ago (2015-07-18 07:11:25 UTC) #38
gab
On 2015/07/18 07:06:51, Takashi Toyoshima (chromium) wrote: > We can not use a Lock here ...
5 years, 5 months ago (2015-07-19 23:39:32 UTC) #39
Takashi Toyoshima
For now, posix implementation blocks in Start*() until the newly created thread starts running. So, ...
5 years, 5 months ago (2015-07-20 13:37:46 UTC) #40
Lei Zhang
Looking good. Can you add a unit test that reads thread_id() from a different thread? ...
5 years, 5 months ago (2015-07-20 21:27:32 UTC) #41
Takashi Toyoshima
PTAL Patch Set 16. https://chromiumcodereview.appspot.com/1207823004/diff/410001/base/threading/platform_thread_win.cc File base/threading/platform_thread_win.cc (right): https://chromiumcodereview.appspot.com/1207823004/diff/410001/base/threading/platform_thread_win.cc#newcode117 base/threading/platform_thread_win.cc:117: PlatformThreadId thread_id; On 2015/07/20 21:27:32, ...
5 years, 5 months ago (2015-07-21 16:05:37 UTC) #42
gab
On 2015/07/20 13:37:46, Takashi Toyoshima (chromium) wrote: > For now, posix implementation blocks in Start*() ...
5 years, 5 months ago (2015-07-21 16:06:31 UTC) #43
Takashi Toyoshima
Here is a simple example. 1: Thread thread; 2: thread.Start(); 3: // some other tasks ...
5 years, 5 months ago (2015-07-21 17:42:02 UTC) #44
gab
On 2015/07/21 17:42:02, Takashi Toyoshima (chromium) wrote: > Here is a simple example. > > ...
5 years, 5 months ago (2015-07-21 17:55:27 UTC) #45
Takashi Toyoshima
Is there any reason to think this case so seriously? What is different from mutex ...
5 years, 5 months ago (2015-07-21 18:15:06 UTC) #46
Takashi Toyoshima
I prefer to be realist rather than idealist here, but I will follow base owner's ...
5 years, 5 months ago (2015-07-21 18:17:00 UTC) #47
gab
On 2015/07/21 18:15:06, Takashi Toyoshima (chromium) wrote: > Is there any reason to think this ...
5 years, 5 months ago (2015-07-21 19:01:55 UTC) #48
Lei Zhang
This is just my opinion. Feel free to disagree. :) On 2015/07/21 19:01:55, gab wrote: ...
5 years, 5 months ago (2015-07-22 01:37:51 UTC) #49
gab
On 2015/07/22 01:37:51, Lei Zhang wrote: > This is just my opinion. Feel free to ...
5 years, 5 months ago (2015-07-22 17:26:56 UTC) #50
Takashi Toyoshima
+jam@ for caller side mechanical changes on components, gpu, media, sandbox, and win8. Lei: thank ...
5 years, 5 months ago (2015-07-23 06:29:06 UTC) #52
jam
lgtm
5 years, 5 months ago (2015-07-23 16:26:50 UTC) #53
jam
On 2015/07/23 16:26:50, jam wrote: > lgtm btw for future reference, you don't need owners ...
5 years, 5 months ago (2015-07-23 16:27:32 UTC) #54
gab
lgtm w/ two last nits. Thanks, Gab https://codereview.chromium.org/1207823004/diff/470001/base/threading/platform_thread_win.cc File base/threading/platform_thread_win.cc (right): https://codereview.chromium.org/1207823004/diff/470001/base/threading/platform_thread_win.cc#newcode118 base/threading/platform_thread_win.cc:118: CreateThread(nullptr, stack_size, ...
5 years, 5 months ago (2015-07-23 17:16:15 UTC) #55
Lei Zhang
base/ lgtm with gab's comments addressed.
5 years, 5 months ago (2015-07-23 18:09:13 UTC) #56
Takashi Toyoshima
Thank you everyone for a long review. (Sorry, it takes three weeks...) jam@ thank you ...
5 years, 5 months ago (2015-07-24 03:47:11 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1207823004/490001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1207823004/490001
5 years, 5 months ago (2015-07-24 03:54:56 UTC) #60
commit-bot: I haz the power
Try jobs failed on following builders: android_clang_dbg_recipe on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/android_clang_dbg_recipe/builds/100615) android_compile_dbg on tryserver.chromium.linux (JOB_FAILED, ...
5 years, 5 months ago (2015-07-24 04:04:42 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1207823004/490001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1207823004/490001
5 years, 5 months ago (2015-07-24 06:29:16 UTC) #64
commit-bot: I haz the power
Committed patchset #18 (id:490001)
5 years, 5 months ago (2015-07-24 09:25:41 UTC) #65
commit-bot: I haz the power
5 years, 5 months ago (2015-07-24 09:26:13 UTC) #66
Message was sent while issue was closed.
Patchset 18 (id:??) landed as
https://crrev.com/c41261e9491c3a763c472fe35737ec36200d6310
Cr-Commit-Position: refs/heads/master@{#340242}

Powered by Google App Engine
This is Rietveld 408576698