Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(23)

Side by Side Diff: components/nacl/zygote/nacl_fork_delegate_linux.cc

Issue 24449002: NaCl: Clean up how FDs are passed to nacl_helper instances on Linux (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Cleanup: move constants Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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() == kParentFDIndex + 1);
jln (very slow on Chromium) 2013/10/07 18:12:06 kNumPassedFds?
Mark Seaborn 2013/10/08 18:31:06 Done.
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698