DescriptionNaCl: 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 #
Messages
Total messages: 16 (0 generated)
|