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

Issue 24449002: NaCl: Clean up how FDs are passed to nacl_helper instances on Linux (Closed)

Created:
7 years, 3 months ago by Mark Seaborn
Modified:
7 years, 2 months ago
CC:
chromium-reviews, joi+watch-content_chromium.org, darin-cc_chromium.org, rmcilroy
Visibility:
Public.

Description

NaCl: Clean up how FDs are passed to nacl_helper instances on Linux child_process_launcher.cc constructs a mapping from FD numbers to FDs, and normal Chromium child processes receive this as a mapping. However, before this change, when zygote_linux.cc passed these FDs to nacl_helper, it stripped the keys from the mapping and only passed the values. This meant that if child_process_launcher.cc were changed to add more key+value pairs to the FD mapping, nacl_helper_linux.cc would need to be updated to use or skip over them. Also, the order in which child_process_launcher.cc adds the FDs to the mapping would be significant, but only to nacl_helper, which would be weird. This would be particularly awkward for FDs that are added to the mapping conditionally. We clean this up by explicitly taking the one FD that nacl_helper needs from the FD mapping, rather than passing across all of the mapping's values. The aim of this cleanup is to simplify this change -- https://codereview.chromium.org/22911027/ -- which changes child_process_launcher.cc to add an FD conditionally. Also make the #defines of the FD numbers clearer by moving them to zygote_fork_delegate_linux.h, since that's the component that's responsible for them. BUG=none TEST=NaCl tests in browser_tests Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=228228

Patch Set 1 #

Total comments: 7

Patch Set 2 : Cleanup: move constants #

Total comments: 8

Patch Set 3 : Review - cleanup #

Total comments: 2

Patch Set 4 : Review - cleanup #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -26 lines) Patch
M chrome/nacl/nacl_helper_linux.cc View 1 2 6 chunks +12 lines, -9 lines 0 comments Download
M components/nacl/common/nacl_helper_linux.h View 1 1 chunk +0 lines, -11 lines 0 comments Download
M components/nacl/zygote/nacl_fork_delegate_linux.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download
M content/public/common/zygote_fork_delegate_linux.h View 1 2 3 1 chunk +12 lines, -0 lines 0 comments Download
M content/zygote/zygote_linux.h View 2 chunks +2 lines, -1 line 0 comments Download
M content/zygote/zygote_linux.cc View 1 4 chunks +19 lines, -4 lines 0 comments Download

Messages

Total messages: 16 (0 generated)
Mark Seaborn
7 years, 2 months ago (2013-09-25 17:24:32 UTC) #1
jln (very slow on Chromium)
(Sorry for the long review delay) https://chromiumcodereview.appspot.com/24449002/diff/1/content/zygote/zygote_linux.cc File content/zygote/zygote_linux.cc (right): https://chromiumcodereview.appspot.com/24449002/diff/1/content/zygote/zygote_linux.cc#newcode320 content/zygote/zygote_linux.cc:320: fds.push_back(ipc_channel_fd); I don't ...
7 years, 2 months ago (2013-09-30 19:15:39 UTC) #2
Mark Seaborn
https://chromiumcodereview.appspot.com/24449002/diff/1/content/zygote/zygote_linux.cc File content/zygote/zygote_linux.cc (right): https://chromiumcodereview.appspot.com/24449002/diff/1/content/zygote/zygote_linux.cc#newcode320 content/zygote/zygote_linux.cc:320: fds.push_back(ipc_channel_fd); On 2013/09/30 19:15:39, jln wrote: > I don't ...
7 years, 2 months ago (2013-10-01 22:32:53 UTC) #3
jln (very slow on Chromium)
lgtm Feel free to add more comments / interface documentation in general, as it's generally ...
7 years, 2 months ago (2013-10-01 22:51:46 UTC) #4
Mark Seaborn
https://chromiumcodereview.appspot.com/24449002/diff/1/content/zygote/zygote_linux.cc File content/zygote/zygote_linux.cc (right): https://chromiumcodereview.appspot.com/24449002/diff/1/content/zygote/zygote_linux.cc#newcode320 content/zygote/zygote_linux.cc:320: fds.push_back(ipc_channel_fd); On 2013/10/01 22:51:46, jln wrote: > > Maybe ...
7 years, 2 months ago (2013-10-07 15:23:13 UTC) #5
jln (very slow on Chromium)
https://codereview.chromium.org/24449002/diff/12001/chrome/nacl/nacl_helper_linux.cc File chrome/nacl/nacl_helper_linux.cc (right): https://codereview.chromium.org/24449002/diff/12001/chrome/nacl/nacl_helper_linux.cc#newcode75 chrome/nacl/nacl_helper_linux.cc:75: int parent_fd = child_fds[content::ZygoteForkDelegate::kParentFDIndex]; Do you want to make ...
7 years, 2 months ago (2013-10-07 18:12:06 UTC) #6
Mark Seaborn
https://codereview.chromium.org/24449002/diff/12001/chrome/nacl/nacl_helper_linux.cc File chrome/nacl/nacl_helper_linux.cc (right): https://codereview.chromium.org/24449002/diff/12001/chrome/nacl/nacl_helper_linux.cc#newcode75 chrome/nacl/nacl_helper_linux.cc:75: int parent_fd = child_fds[content::ZygoteForkDelegate::kParentFDIndex]; On 2013/10/07 18:12:06, jln wrote: ...
7 years, 2 months ago (2013-10-08 18:31:06 UTC) #7
jln (very slow on Chromium)
Tiny, non mandatory nit. https://codereview.chromium.org/24449002/diff/40001/content/public/common/zygote_fork_delegate_linux.h File content/public/common/zygote_fork_delegate_linux.h (right): https://codereview.chromium.org/24449002/diff/40001/content/public/common/zygote_fork_delegate_linux.h#newcode55 content/public/common/zygote_fork_delegate_linux.h:55: kNumPassedFDs = 3 Small nit: ...
7 years, 2 months ago (2013-10-08 19:33:36 UTC) #8
Mark Seaborn
https://codereview.chromium.org/24449002/diff/40001/content/public/common/zygote_fork_delegate_linux.h File content/public/common/zygote_fork_delegate_linux.h (right): https://codereview.chromium.org/24449002/diff/40001/content/public/common/zygote_fork_delegate_linux.h#newcode55 content/public/common/zygote_fork_delegate_linux.h:55: kNumPassedFDs = 3 On 2013/10/08 19:33:36, jln wrote: > ...
7 years, 2 months ago (2013-10-08 21:01:56 UTC) #9
Mark Seaborn
+jam for OWNERS review of zygote_fork_delegate_linux.h.
7 years, 2 months ago (2013-10-08 22:30:11 UTC) #10
jam
On 2013/10/08 22:30:11, Mark Seaborn wrote: > +jam for OWNERS review of zygote_fork_delegate_linux.h. I'm not ...
7 years, 2 months ago (2013-10-10 04:54:54 UTC) #11
jam
On 2013/10/08 22:30:11, Mark Seaborn wrote: > +jam for OWNERS review of zygote_fork_delegate_linux.h. I'm not ...
7 years, 2 months ago (2013-10-10 04:54:54 UTC) #12
Mark Seaborn
On 9 October 2013 21:54, <jam@chromium.org> wrote: > On 2013/10/08 22:30:11, Mark Seaborn wrote: > ...
7 years, 2 months ago (2013-10-10 16:56:18 UTC) #13
jam
On 2013/10/10 16:56:18, Mark Seaborn wrote: > On 9 October 2013 21:54, <mailto:jam@chromium.org> wrote: > ...
7 years, 2 months ago (2013-10-11 16:13:32 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mseaborn@chromium.org/24449002/48001
7 years, 2 months ago (2013-10-11 16:26:36 UTC) #15
commit-bot: I haz the power
7 years, 2 months ago (2013-10-11 19:39:42 UTC) #16
Message was sent while issue was closed.
Change committed as 228228

Powered by Google App Engine
This is Rietveld 408576698