OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser/zygote_host_linux.h" | 5 #include "chrome/browser/zygote_host_linux.h" |
6 | 6 |
7 #include <sys/socket.h> | 7 #include <sys/socket.h> |
8 #include <sys/stat.h> | 8 #include <sys/stat.h> |
9 #include <sys/types.h> | 9 #include <sys/types.h> |
10 #include <unistd.h> | 10 #include <unistd.h> |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
97 // Should this list be obtained from browser_render_process_host.cc? | 97 // Should this list be obtained from browser_render_process_host.cc? |
98 static const char* kForwardSwitches[] = { | 98 static const char* kForwardSwitches[] = { |
99 switches::kAllowSandboxDebugging, | 99 switches::kAllowSandboxDebugging, |
100 switches::kLoggingLevel, | 100 switches::kLoggingLevel, |
101 switches::kEnableLogging, // Support, e.g., --enable-logging=stderr. | 101 switches::kEnableLogging, // Support, e.g., --enable-logging=stderr. |
102 switches::kV, | 102 switches::kV, |
103 switches::kVModule, | 103 switches::kVModule, |
104 switches::kUserDataDir, // Make logs go to the right file. | 104 switches::kUserDataDir, // Make logs go to the right file. |
105 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. | 105 // Load (in-process) Pepper plugins in-process in the zygote pre-sandbox. |
106 switches::kRegisterPepperPlugins, | 106 switches::kRegisterPepperPlugins, |
107 #if defined(USE_SECCOMP_SANDBOX) | |
108 switches::kDisableSeccompSandbox, | 107 switches::kDisableSeccompSandbox, |
109 #else | |
110 switches::kEnableSeccompSandbox, | 108 switches::kEnableSeccompSandbox, |
111 #endif | |
112 }; | 109 }; |
113 cmd_line.CopySwitchesFrom(browser_command_line, kForwardSwitches, | 110 cmd_line.CopySwitchesFrom(browser_command_line, kForwardSwitches, |
114 arraysize(kForwardSwitches)); | 111 arraysize(kForwardSwitches)); |
115 | 112 |
116 sandbox_binary_ = sandbox_cmd.c_str(); | 113 sandbox_binary_ = sandbox_cmd.c_str(); |
117 struct stat st; | 114 struct stat st; |
118 | 115 |
119 if (!sandbox_cmd.empty() && stat(sandbox_binary_.c_str(), &st) == 0) { | 116 if (!sandbox_cmd.empty() && stat(sandbox_binary_.c_str(), &st) == 0) { |
120 if (access(sandbox_binary_.c_str(), X_OK) == 0 && | 117 if (access(sandbox_binary_.c_str(), X_OK) == 0 && |
121 (st.st_uid == 0) && | 118 (st.st_uid == 0) && |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
355 !read_pickle.ReadInt(&iter, &tmp_exit_code)) { | 352 !read_pickle.ReadInt(&iter, &tmp_exit_code)) { |
356 LOG(WARNING) << "Error parsing GetTerminationStatus response from zygote."; | 353 LOG(WARNING) << "Error parsing GetTerminationStatus response from zygote."; |
357 return base::TERMINATION_STATUS_NORMAL_TERMINATION; | 354 return base::TERMINATION_STATUS_NORMAL_TERMINATION; |
358 } | 355 } |
359 | 356 |
360 if (exit_code) | 357 if (exit_code) |
361 *exit_code = tmp_exit_code; | 358 *exit_code = tmp_exit_code; |
362 | 359 |
363 return static_cast<base::TerminationStatus>(status); | 360 return static_cast<base::TerminationStatus>(status); |
364 } | 361 } |
OLD | NEW |