diff options
author | mdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 00:07:33 +0000 |
---|---|---|
committer | mdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 00:07:33 +0000 |
commit | 3a1612420741cb7c84cb0a1d3b2fd2b6fcc68a34 (patch) | |
tree | 79b4266127a1a5aa620113d43467d9372c06b009 /content/zygote | |
parent | 45214559b6f71458336f00f850e02e43d3cd8415 (diff) | |
download | chromium_src-3a1612420741cb7c84cb0a1d3b2fd2b6fcc68a34.zip chromium_src-3a1612420741cb7c84cb0a1d3b2fd2b6fcc68a34.tar.gz chromium_src-3a1612420741cb7c84cb0a1d3b2fd2b6fcc68a34.tar.bz2 |
Clean up ZygoteForkDelegate API a little
We always pass channel_switch as "--channel=XYZ" and then the
recipient pointlessly verifies that it still starts with "--channel=".
So instead rename AckChild() parameter to channel_id and just pass the
"XYZ" part to remove a possible failure case, and simplify the
receiving code a little bit.
BUG=357670
Review URL: https://codereview.chromium.org/239333009
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264681 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/zygote')
-rw-r--r-- | content/zygote/zygote_linux.cc | 6 | ||||
-rw-r--r-- | content/zygote/zygote_linux.h | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc index 8ea9714..04e9d83 100644 --- a/content/zygote/zygote_linux.cc +++ b/content/zygote/zygote_linux.cc @@ -296,7 +296,7 @@ void Zygote::HandleGetTerminationStatus(int fd, int Zygote::ForkWithRealPid(const std::string& process_type, const base::GlobalDescriptors::Mapping& fd_mapping, - const std::string& channel_switch, + const std::string& channel_id, std::string* uma_name, int* uma_sample, int* uma_boundary_value) { @@ -411,7 +411,7 @@ int Zygote::ForkWithRealPid(const std::string& process_type, process_info_map_[real_pid].started_from_helper = use_helper; if (use_helper) { - if (!helper_->AckChild(pipe_fds[1], channel_switch)) { + if (!helper_->AckChild(pipe_fds[1], channel_id)) { LOG(ERROR) << "Failed to synchronise with zygote fork helper"; goto error; } @@ -467,7 +467,7 @@ base::ProcessId Zygote::ReadArgsAndFork(const Pickle& pickle, return -1; args.push_back(arg); if (arg.compare(0, channel_id_prefix.length(), channel_id_prefix) == 0) - channel_id = arg; + channel_id = arg.substr(channel_id_prefix.length()); } if (!pickle.ReadInt(&iter, &numfds)) diff --git a/content/zygote/zygote_linux.h b/content/zygote/zygote_linux.h index 37e89b5..140dfa67 100644 --- a/content/zygote/zygote_linux.h +++ b/content/zygote/zygote_linux.h @@ -79,7 +79,7 @@ class Zygote { // UMA_HISTOGRAM_ENUMERATION. int ForkWithRealPid(const std::string& process_type, const base::GlobalDescriptors::Mapping& fd_mapping, - const std::string& channel_switch, + const std::string& channel_id, std::string* uma_name, int* uma_sample, int* uma_boundary_value); |