summaryrefslogtreecommitdiffstats
path: root/components/nacl/zygote
diff options
context:
space:
mode:
authormdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 00:07:33 +0000
committermdempsky@chromium.org <mdempsky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-18 00:07:33 +0000
commit3a1612420741cb7c84cb0a1d3b2fd2b6fcc68a34 (patch)
tree79b4266127a1a5aa620113d43467d9372c06b009 /components/nacl/zygote
parent45214559b6f71458336f00f850e02e43d3cd8415 (diff)
downloadchromium_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 'components/nacl/zygote')
-rw-r--r--components/nacl/zygote/nacl_fork_delegate_linux.cc9
-rw-r--r--components/nacl/zygote/nacl_fork_delegate_linux.h3
2 files changed, 5 insertions, 7 deletions
diff --git a/components/nacl/zygote/nacl_fork_delegate_linux.cc b/components/nacl/zygote/nacl_fork_delegate_linux.cc
index 049d6f3..558344d 100644
--- a/components/nacl/zygote/nacl_fork_delegate_linux.cc
+++ b/components/nacl/zygote/nacl_fork_delegate_linux.cc
@@ -329,11 +329,10 @@ pid_t NaClForkDelegate::Fork(const std::string& process_type,
return nacl_child;
}
-bool NaClForkDelegate::AckChild(const int fd,
- const std::string& channel_switch) {
- int nwritten = HANDLE_EINTR(write(fd, channel_switch.c_str(),
- channel_switch.length()));
- if (nwritten != static_cast<int>(channel_switch.length())) {
+bool NaClForkDelegate::AckChild(const int fd, const std::string& channel_id) {
+ ssize_t nwritten =
+ HANDLE_EINTR(write(fd, channel_id.c_str(), channel_id.length()));
+ if (static_cast<size_t>(nwritten) != channel_id.length()) {
return false;
}
return true;
diff --git a/components/nacl/zygote/nacl_fork_delegate_linux.h b/components/nacl/zygote/nacl_fork_delegate_linux.h
index 4158a5a..a0860b69 100644
--- a/components/nacl/zygote/nacl_fork_delegate_linux.h
+++ b/components/nacl/zygote/nacl_fork_delegate_linux.h
@@ -30,8 +30,7 @@ class NaClForkDelegate : public content::ZygoteForkDelegate {
int* uma_sample, int* uma_boundary_value) OVERRIDE;
virtual pid_t Fork(const std::string& process_type,
const std::vector<int>& fds) OVERRIDE;
- virtual bool AckChild(int fd,
- const std::string& channel_switch) OVERRIDE;
+ virtual bool AckChild(int fd, const std::string& channel_id) OVERRIDE;
virtual bool GetTerminationStatus(pid_t pid, bool known_dead,
base::TerminationStatus* status,
int* exit_code) OVERRIDE;