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

Issue 1186873006: Add Get/SetUniqueIdForProcess. (Closed)

Created:
5 years, 6 months ago by rickyz (no longer on Chrome)
Modified:
5 years, 2 months ago
CC:
chromium-reviews, darin-cc_chromium.org, erikwright+watch_chromium.org, jam, rickyz+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add Get/SetUniqueIdForProcess. base::GetCurrentProcId is sometimes assumed to return a unique identifier for a process. With PID namespces, each renderer has PID 1, which is makes the PID for this purpose. This change introduces a supported way to obtain a unique ID for a process. Currently, the ID is the process's PID outside of the PID namespace. BUG=501069 Committed: https://crrev.com/5b937a380101191cdd460033f4b72394b6638798 Cr-Commit-Position: refs/heads/master@{#355440}

Patch Set 1 #

Total comments: 6

Patch Set 2 : Respond to comments. #

Total comments: 4

Patch Set 3 : Respond to comments. #

Total comments: 8

Patch Set 4 : Respond to comments. #

Total comments: 19

Patch Set 5 : Respond to comments. #

Total comments: 1

Patch Set 6 : Rebase #

Total comments: 4

Patch Set 7 : Use uint32_t, prettify comments #

Total comments: 16

Patch Set 8 : Respond to comments. #

Patch Set 9 : Mangle unique IDs so that they cannot accidentally be used as PIDs. #

Patch Set 10 : Fix outdated comment #

Patch Set 11 : Get rid of DCHECK_IS_ON. #

Total comments: 4

Patch Set 12 : Respond to comments #

Patch Set 13 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+83 lines, -5 lines) Patch
M base/base.gypi View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M base/process/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M base/process/process_handle.h View 1 2 3 4 5 6 7 8 9 2 chunks +27 lines, -5 lines 0 comments Download
A base/process/process_handle.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +52 lines, -0 lines 0 comments Download
M content/zygote/zygote_linux.cc View 1 2 3 4 5 6 7 8 2 chunks +2 lines, -0 lines 0 comments Download

Messages

Total messages: 60 (9 generated)
rickyz (no longer on Chrome)
5 years, 6 months ago (2015-06-15 21:27:45 UTC) #2
mdempsky
https://codereview.chromium.org/1186873006/diff/1/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/1/base/process/process_handle.cc#newcode7 base/process/process_handle.cc:7: #include <unistd.h> I don't see any use of unistd.h? ...
5 years, 6 months ago (2015-06-15 21:53:09 UTC) #3
rickyz (no longer on Chrome)
https://codereview.chromium.org/1186873006/diff/1/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/1/base/process/process_handle.cc#newcode7 base/process/process_handle.cc:7: #include <unistd.h> On 2015/06/15 21:53:09, mdempsky wrote: > I ...
5 years, 6 months ago (2015-06-15 22:09:47 UTC) #6
jln (very slow on Chromium)
Seems good in general, but thread-safety is an issue. Probably using a lazy instance would ...
5 years, 6 months ago (2015-06-15 23:25:08 UTC) #7
jln (very slow on Chromium)
Also: could you link a bug explaining the overall problem and the solution being built?
5 years, 6 months ago (2015-06-15 23:25:40 UTC) #8
jln (very slow on Chromium)
Also: in DEBUG builds, could you store the current pid alongside the unique id? Then ...
5 years, 6 months ago (2015-06-15 23:33:28 UTC) #9
rickyz (no longer on Chrome)
On 2015/06/15 23:33:28, jln wrote: > Also: in DEBUG builds, could you store the current ...
5 years, 6 months ago (2015-06-16 01:19:26 UTC) #10
jln (very slow on Chromium)
https://codereview.chromium.org/1186873006/diff/80001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/80001/base/process/process_handle.cc#newcode1 base/process/process_handle.cc:1: // Copyright (c) 2013 The Chromium Authors. All rights ...
5 years, 6 months ago (2015-06-16 22:59:01 UTC) #11
rickyz (no longer on Chrome)
https://codereview.chromium.org/1186873006/diff/60001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/60001/base/process/process_handle.cc#newcode22 base/process/process_handle.cc:22: g_unique_id = unique_id; On 2015/06/15 23:25:08, jln wrote: > ...
5 years, 6 months ago (2015-06-17 00:50:34 UTC) #12
jln (very slow on Chromium)
lgtm We might want to use a uint64 instead of a uint32, but other than ...
5 years, 6 months ago (2015-06-17 00:55:39 UTC) #13
rickyz (no longer on Chrome)
Hey, hope you don't mind taking a look at this small change :-) The background ...
5 years, 6 months ago (2015-06-17 01:04:36 UTC) #15
willchan no longer on Chromium
Sorry, no longer on Chromium. Redirecting to Dana. Hi Dana! https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc#newcode25 ...
5 years, 6 months ago (2015-06-17 01:51:45 UTC) #17
willchan no longer on Chromium
Sorry, no longer on Chromium. Redirecting to Dana. Hi Dana!
5 years, 6 months ago (2015-06-17 01:51:48 UTC) #18
rickyz (no longer on Chrome)
Thanks for the comments! https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc#newcode25 base/process/process_handle.cc:25: #ifndef NDEBUG On 2015/06/17 01:51:44, ...
5 years, 6 months ago (2015-06-17 03:04:06 UTC) #19
danakj
https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc#newcode25 base/process/process_handle.cc:25: #ifndef NDEBUG On 2015/06/17 03:04:06, rickyz wrote: > On ...
5 years, 6 months ago (2015-06-17 17:09:53 UTC) #20
danakj
https://codereview.chromium.org/1186873006/diff/100001/base/base.gypi File base/base.gypi (right): https://codereview.chromium.org/1186873006/diff/100001/base/base.gypi#newcode477 base/base.gypi:477: 'process/process_handle.cc', add the header here too, it was omitted. ...
5 years, 6 months ago (2015-06-17 17:17:16 UTC) #21
rickyz (no longer on Chrome)
https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.cc#newcode22 base/process/process_handle.cc:22: return static_cast<uint32>(GetCurrentProcId()); On 2015/06/17 17:17:16, danakj wrote: > Should ...
5 years, 6 months ago (2015-06-17 19:53:41 UTC) #22
danakj
https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.h File base/process/process_handle.h (right): https://codereview.chromium.org/1186873006/diff/100001/base/process/process_handle.h#newcode54 base/process/process_handle.h:54: // WARNING: To avoid inconsistent results from GetUniqueIdForProcess, this ...
5 years, 6 months ago (2015-06-17 19:56:23 UTC) #23
chromium-reviews
Ah, though the thing is that after forking, it needs to return a different call ...
5 years, 6 months ago (2015-06-17 19:59:56 UTC) #24
danakj
Ah right, forking. OK. On 2015/06/17 01:04:36, rickyz wrote: > Hey, hope you don't mind ...
5 years, 6 months ago (2015-06-18 17:16:07 UTC) #25
danakj
On 2015/06/18 17:16:07, danakj wrote: > Ah right, forking. OK. > > On 2015/06/17 01:04:36, ...
5 years, 6 months ago (2015-06-18 17:16:19 UTC) #26
rickyz (no longer on Chrome)
On 2015/06/18 17:16:19, danakj wrote: > > Here's an example CL that dealt with this ...
5 years, 6 months ago (2015-06-18 19:22:25 UTC) #27
rickyz (no longer on Chrome)
Friendly ping - also adding thestig@ who noticed that log messages were always showing a ...
5 years, 4 months ago (2015-07-28 21:34:14 UTC) #29
Lei Zhang
Ah, ;ooks like you noticed the "pid 1" issue a long time ago. https://chromiumcodereview.appspot.com/1186873006/diff/140001/base/process/process_handle.cc File ...
5 years, 4 months ago (2015-07-28 21:54:23 UTC) #30
Lei Zhang
*looks*
5 years, 4 months ago (2015-07-28 21:54:40 UTC) #31
rickyz (no longer on Chrome)
https://codereview.chromium.org/1186873006/diff/140001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/140001/base/process/process_handle.cc#newcode15 base/process/process_handle.cc:15: // The process which set g_unique_id. On 2015/07/28 21:54:23, ...
5 years, 4 months ago (2015-07-28 22:39:37 UTC) #32
jln (very slow on Chromium)
Friendly ping?
5 years, 4 months ago (2015-08-05 16:02:51 UTC) #33
Lei Zhang
On 2015/08/05 16:02:51, jln wrote: > Friendly ping? Pong? Do you want me to review? ...
5 years, 4 months ago (2015-08-05 18:09:38 UTC) #34
danakj
https://codereview.chromium.org/1186873006/diff/120001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/120001/base/process/process_handle.cc#newcode28 base/process/process_handle.cc:28: DCHECK_EQ(static_cast<uint32>(GetCurrentProcId()), g_procid); you'll have to wrap this in DCHECK_IS_ON() ...
5 years, 4 months ago (2015-08-05 19:52:26 UTC) #35
rickyz (no longer on Chrome)
Thanks for the comments - sorry about the slow response - just got back from ...
5 years, 4 months ago (2015-08-13 23:16:55 UTC) #36
rickyz (no longer on Chrome)
Thanks for the comments - sorry about the slow response - just got back from ...
5 years, 4 months ago (2015-08-13 23:16:57 UTC) #37
mdempsky
On 2015/08/13 23:16:55, rickyz wrote: > From looking at filename_rules.gypi, it seems like _linux.cc files ...
5 years, 4 months ago (2015-08-17 20:42:11 UTC) #38
jln (very slow on Chromium)
ricky, ping? I would love to see this clean-up wrapped up.
5 years, 3 months ago (2015-09-11 02:36:01 UTC) #39
rickyz (no longer on Chrome)
On 2015/09/11 at 02:36:01, jln wrote: > ricky, ping? I would love to see this ...
5 years, 3 months ago (2015-09-15 01:41:04 UTC) #40
danakj
Sorry I didn't see that you'd replied to the comments :x https://codereview.chromium.org/1186873006/diff/160001/base/process/process_handle.h File base/process/process_handle.h (right): ...
5 years, 3 months ago (2015-09-15 18:06:39 UTC) #41
jln (very slow on Chromium)
On 2015/09/15 18:06:39, danakj wrote: > Sorry I didn't see that you'd replied to the ...
5 years, 3 months ago (2015-09-15 18:25:02 UTC) #42
danakj
https://codereview.chromium.org/1186873006/diff/160001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/160001/base/process/process_handle.cc#newcode23 base/process/process_handle.cc:23: return static_cast<uint32_t>(GetCurrentProcId()); On 2015/08/13 23:16:55, rickyz wrote: > On ...
5 years, 3 months ago (2015-09-15 18:36:32 UTC) #43
jln (very slow on Chromium)
On 2015/09/15 18:36:32, danakj wrote: > https://codereview.chromium.org/1186873006/diff/160001/base/process/process_handle.cc > File base/process/process_handle.cc (right): > > https://codereview.chromium.org/1186873006/diff/160001/base/process/process_handle.cc#newcode23 > ...
5 years, 3 months ago (2015-09-22 18:26:08 UTC) #44
danakj
On Tue, Sep 22, 2015 at 11:26 AM, <jln@chromium.org> wrote: > On 2015/09/15 18:36:32, danakj ...
5 years, 3 months ago (2015-09-22 18:38:15 UTC) #45
jln (very slow on Chromium)
On 2015/09/22 18:38:15, danakj wrote: > > > Is the current concern mostly about the ...
5 years, 3 months ago (2015-09-22 19:31:04 UTC) #47
rickyz (no longer on Chrome)
> On 2015/09/22 18:38:15, danakj wrote: > > Right, I want the "fake id namespace" ...
5 years, 3 months ago (2015-09-22 21:08:48 UTC) #48
danakj
On Tue, Sep 22, 2015 at 12:31 PM, <jln@chromium.org> wrote: > On 2015/09/22 18:38:15, danakj ...
5 years, 3 months ago (2015-09-22 21:16:42 UTC) #49
jln (very slow on Chromium)
On 2015/09/22 21:16:42, danakj wrote: > On Tue, Sep 22, 2015 at 12:31 PM, <mailto:jln@chromium.org> ...
5 years, 3 months ago (2015-09-22 21:24:44 UTC) #50
rickyz (no longer on Chrome)
On 2015/09/22 at 21:24:44, jln wrote: > This seems good. How about going even farther ...
5 years, 3 months ago (2015-09-23 00:25:45 UTC) #51
danakj
LG, 2 things https://codereview.chromium.org/1186873006/diff/240001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/240001/base/process/process_handle.cc#newcode14 base/process/process_handle.cc:14: // This is never a valid ...
5 years, 3 months ago (2015-09-23 21:56:32 UTC) #52
rickyz (no longer on Chrome)
Thanks! https://codereview.chromium.org/1186873006/diff/240001/base/process/process_handle.cc File base/process/process_handle.cc (right): https://codereview.chromium.org/1186873006/diff/240001/base/process/process_handle.cc#newcode14 base/process/process_handle.cc:14: // This is never a valid mangled process ...
5 years, 3 months ago (2015-09-24 01:22:03 UTC) #53
danakj
Sorry got sick and disappeared for a bit. LGTM
5 years, 2 months ago (2015-10-13 23:18:18 UTC) #54
rickyz (no longer on Chrome)
Ah, no worries, I've been quite distracted lately too, cqing
5 years, 2 months ago (2015-10-21 22:25:30 UTC) #57
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1186873006/280001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1186873006/280001
5 years, 2 months ago (2015-10-21 22:25:58 UTC) #58
commit-bot: I haz the power
Committed patchset #13 (id:280001)
5 years, 2 months ago (2015-10-21 23:52:34 UTC) #59
commit-bot: I haz the power
5 years, 2 months ago (2015-10-21 23:53:10 UTC) #60
Message was sent while issue was closed.
Patchset 13 (id:??) landed as
https://crrev.com/5b937a380101191cdd460033f4b72394b6638798
Cr-Commit-Position: refs/heads/master@{#355440}

Powered by Google App Engine
This is Rietveld 408576698