| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/nacl/zygote/nacl_fork_delegate_linux.h" | 5 #include "components/nacl/zygote/nacl_fork_delegate_linux.h" |
| 6 | 6 |
| 7 #include <signal.h> | 7 #include <signal.h> |
| 8 #include <stdlib.h> | 8 #include <stdlib.h> |
| 9 #include <sys/resource.h> | 9 #include <sys/resource.h> |
| 10 #include <sys/socket.h> | 10 #include <sys/socket.h> |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return false; | 251 return false; |
| 252 *uma_name = "NaCl.Client.Helper.StateOnFork"; | 252 *uma_name = "NaCl.Client.Helper.StateOnFork"; |
| 253 *uma_sample = status_; | 253 *uma_sample = status_; |
| 254 *uma_boundary_value = kNaClHelperStatusBoundary; | 254 *uma_boundary_value = kNaClHelperStatusBoundary; |
| 255 return status_ == kNaClHelperSuccess; | 255 return status_ == kNaClHelperSuccess; |
| 256 } | 256 } |
| 257 | 257 |
| 258 pid_t NaClForkDelegate::Fork(const std::vector<int>& fds) { | 258 pid_t NaClForkDelegate::Fork(const std::vector<int>& fds) { |
| 259 VLOG(1) << "NaClForkDelegate::Fork"; | 259 VLOG(1) << "NaClForkDelegate::Fork"; |
| 260 | 260 |
| 261 DCHECK(fds.size() == kNaClParentFDIndex + 1); | 261 DCHECK(fds.size() == kNumPassedFDs); |
| 262 | 262 |
| 263 // First, send a remote fork request. | 263 // First, send a remote fork request. |
| 264 Pickle write_pickle; | 264 Pickle write_pickle; |
| 265 write_pickle.WriteInt(kNaClForkRequest); | 265 write_pickle.WriteInt(kNaClForkRequest); |
| 266 | 266 |
| 267 char reply_buf[kNaClMaxIPCMessageLength]; | 267 char reply_buf[kNaClMaxIPCMessageLength]; |
| 268 ssize_t reply_size = 0; | 268 ssize_t reply_size = 0; |
| 269 bool got_reply = | 269 bool got_reply = |
| 270 SendIPCRequestAndReadReply(fd_, fds, write_pickle, | 270 SendIPCRequestAndReadReply(fd_, fds, write_pickle, |
| 271 reply_buf, sizeof(reply_buf), &reply_size); | 271 reply_buf, sizeof(reply_buf), &reply_size); |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 332 int remote_exit_code; | 332 int remote_exit_code; |
| 333 if (!iter.ReadInt(&remote_exit_code)) { | 333 if (!iter.ReadInt(&remote_exit_code)) { |
| 334 LOG(ERROR) << "GetTerminationStatus: pickle failed"; | 334 LOG(ERROR) << "GetTerminationStatus: pickle failed"; |
| 335 return false; | 335 return false; |
| 336 } | 336 } |
| 337 | 337 |
| 338 *status = static_cast<base::TerminationStatus>(termination_status); | 338 *status = static_cast<base::TerminationStatus>(termination_status); |
| 339 *exit_code = remote_exit_code; | 339 *exit_code = remote_exit_code; |
| 340 return true; | 340 return true; |
| 341 } | 341 } |
| OLD | NEW |