| 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 "chrome/app/nacl_fork_delegate_linux.h" | 5 #include "chrome/app/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 15 matching lines...) Expand all Loading... |
| 26 | 26 |
| 27 NaClForkDelegate::NaClForkDelegate() | 27 NaClForkDelegate::NaClForkDelegate() |
| 28 : status_(kNaClHelperUnused), | 28 : status_(kNaClHelperUnused), |
| 29 sandboxed_(false), | 29 sandboxed_(false), |
| 30 fd_(-1) {} | 30 fd_(-1) {} |
| 31 | 31 |
| 32 /* | 32 /* |
| 33 * Note these need to match up with their counterparts in nacl_helper_linux.c | 33 * Note these need to match up with their counterparts in nacl_helper_linux.c |
| 34 * and nacl_helper_bootstrap_linux.c. | 34 * and nacl_helper_bootstrap_linux.c. |
| 35 */ | 35 */ |
| 36 const char kNaClHelperReservedAtZero[] = "--reserved_at_zero=0xXXXXXXXX"; | 36 const char kNaClHelperReservedAtZero[] = |
| 37 "--reserved_at_zero=0xXXXXXXXXXXXXXXXX"; |
| 37 const char kNaClHelperRDebug[] = "--r_debug=0xXXXXXXXXXXXXXXXX"; | 38 const char kNaClHelperRDebug[] = "--r_debug=0xXXXXXXXXXXXXXXXX"; |
| 38 | 39 |
| 39 void NaClForkDelegate::Init(const bool sandboxed, | 40 void NaClForkDelegate::Init(const bool sandboxed, |
| 40 const int browserdesc, | 41 const int browserdesc, |
| 41 const int sandboxdesc) { | 42 const int sandboxdesc) { |
| 42 VLOG(1) << "NaClForkDelegate::Init()"; | 43 VLOG(1) << "NaClForkDelegate::Init()"; |
| 43 int fds[2]; | 44 int fds[2]; |
| 44 | 45 |
| 45 sandboxed_ = sandboxed; | 46 sandboxed_ = sandboxed; |
| 46 // Confirm a couple hard-wired assumptions. | 47 // Confirm a couple hard-wired assumptions. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 | 162 |
| 162 bool NaClForkDelegate::AckChild(const int fd, | 163 bool NaClForkDelegate::AckChild(const int fd, |
| 163 const std::string& channel_switch) { | 164 const std::string& channel_switch) { |
| 164 int nwritten = HANDLE_EINTR(write(fd, channel_switch.c_str(), | 165 int nwritten = HANDLE_EINTR(write(fd, channel_switch.c_str(), |
| 165 channel_switch.length())); | 166 channel_switch.length())); |
| 166 if (nwritten != static_cast<int>(channel_switch.length())) { | 167 if (nwritten != static_cast<int>(channel_switch.length())) { |
| 167 return false; | 168 return false; |
| 168 } | 169 } |
| 169 return true; | 170 return true; |
| 170 } | 171 } |
| OLD | NEW |