summaryrefslogtreecommitdiffstats
path: root/content/zygote/zygote_linux.h
diff options
context:
space:
mode:
authormseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-11 19:39:41 +0000
committermseaborn@chromium.org <mseaborn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-10-11 19:39:41 +0000
commit9e5a0a62b5d143693d51185ff3ffceec1fd787c6 (patch)
tree40de02eb1a9ad457ac8299b28a1adbbe753e03da /content/zygote/zygote_linux.h
parent880d53b3a0e2e9fcb015e507fbba758130f92aa2 (diff)
downloadchromium_src-9e5a0a62b5d143693d51185ff3ffceec1fd787c6.zip
chromium_src-9e5a0a62b5d143693d51185ff3ffceec1fd787c6.tar.gz
chromium_src-9e5a0a62b5d143693d51185ff3ffceec1fd787c6.tar.bz2
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 Review URL: https://codereview.chromium.org/24449002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@228228 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/zygote/zygote_linux.h')
-rw-r--r--content/zygote/zygote_linux.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/content/zygote/zygote_linux.h b/content/zygote/zygote_linux.h
index ffea49a..37e89b5 100644
--- a/content/zygote/zygote_linux.h
+++ b/content/zygote/zygote_linux.h
@@ -9,6 +9,7 @@
#include <vector>
#include "base/containers/small_map.h"
+#include "base/posix/global_descriptors.h"
#include "base/process/kill.h"
#include "base/process/process.h"
@@ -77,7 +78,7 @@ class Zygote {
// fills in uma_name et al with a report the helper wants to make via
// UMA_HISTOGRAM_ENUMERATION.
int ForkWithRealPid(const std::string& process_type,
- std::vector<int>& fds,
+ const base::GlobalDescriptors::Mapping& fd_mapping,
const std::string& channel_switch,
std::string* uma_name,
int* uma_sample,