| 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 11 matching lines...) Expand all Loading... |
| 22 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" | 22 #include "base/third_party/dynamic_annotations/dynamic_annotations.h" |
| 23 #include "chrome/common/chrome_paths.h" | 23 #include "chrome/common/chrome_paths.h" |
| 24 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 25 #include "chrome/common/nacl_helper_linux.h" | 25 #include "chrome/common/nacl_helper_linux.h" |
| 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 // 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 | 33 // and nacl_helper_bootstrap_linux.c. |
| 34 * and nacl_helper_bootstrap_linux.c. | |
| 35 */ | |
| 36 const char kNaClHelperReservedAtZero[] = | 34 const char kNaClHelperReservedAtZero[] = |
| 37 "--reserved_at_zero=0xXXXXXXXXXXXXXXXX"; | 35 "--reserved_at_zero=0xXXXXXXXXXXXXXXXX"; |
| 38 const char kNaClHelperRDebug[] = "--r_debug=0xXXXXXXXXXXXXXXXX"; | 36 const char kNaClHelperRDebug[] = "--r_debug=0xXXXXXXXXXXXXXXXX"; |
| 39 | 37 |
| 40 void NaClForkDelegate::Init(const bool sandboxed, | 38 void NaClForkDelegate::Init(const bool sandboxed, |
| 41 const int browserdesc, | 39 const int browserdesc, |
| 42 const int sandboxdesc) { | 40 const int sandboxdesc) { |
| 43 VLOG(1) << "NaClForkDelegate::Init()"; | 41 VLOG(1) << "NaClForkDelegate::Init()"; |
| 44 int fds[2]; | 42 int fds[2]; |
| 45 | 43 |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 160 |
| 163 bool NaClForkDelegate::AckChild(const int fd, | 161 bool NaClForkDelegate::AckChild(const int fd, |
| 164 const std::string& channel_switch) { | 162 const std::string& channel_switch) { |
| 165 int nwritten = HANDLE_EINTR(write(fd, channel_switch.c_str(), | 163 int nwritten = HANDLE_EINTR(write(fd, channel_switch.c_str(), |
| 166 channel_switch.length())); | 164 channel_switch.length())); |
| 167 if (nwritten != static_cast<int>(channel_switch.length())) { | 165 if (nwritten != static_cast<int>(channel_switch.length())) { |
| 168 return false; | 166 return false; |
| 169 } | 167 } |
| 170 return true; | 168 return true; |
| 171 } | 169 } |
| OLD | NEW |