OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ |
6 #define CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ | 6 #define CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <unistd.h> | 9 #include <unistd.h> |
10 | 10 |
11 #include <string> | 11 #include <string> |
(...skipping 13 matching lines...) Expand all Loading... |
25 | 25 |
26 // The zygote host is the interface, in the browser process, to the zygote | 26 // The zygote host is the interface, in the browser process, to the zygote |
27 // process. | 27 // process. |
28 class ZygoteHost { | 28 class ZygoteHost { |
29 public: | 29 public: |
30 // Returns the singleton instance. | 30 // Returns the singleton instance. |
31 static ZygoteHost* GetInstance(); | 31 static ZygoteHost* GetInstance(); |
32 | 32 |
33 void Init(const std::string& sandbox_cmd); | 33 void Init(const std::string& sandbox_cmd); |
34 | 34 |
35 // Tries to start a process of type indicated by process_type. | 35 // Tries to start a renderer process. Returns its pid on success, otherwise |
36 // Returns its pid on success, otherwise | |
37 // base::kNullProcessHandle; | 36 // base::kNullProcessHandle; |
38 pid_t ForkRequest(const std::vector<std::string>& command_line, | 37 pid_t ForkRenderer(const std::vector<std::string>& command_line, |
39 const base::GlobalDescriptors::Mapping& mapping, | 38 const base::GlobalDescriptors::Mapping& mapping); |
40 const std::string& process_type); | |
41 void EnsureProcessTerminated(pid_t process); | 39 void EnsureProcessTerminated(pid_t process); |
42 | 40 |
43 // Get the termination status (and, optionally, the exit code) of | 41 // Get the termination status (and, optionally, the exit code) of |
44 // the process. |exit_code| is set to the exit code of the child | 42 // the process. |exit_code| is set to the exit code of the child |
45 // process. (|exit_code| may be NULL.) | 43 // process. (|exit_code| may be NULL.) |
46 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, | 44 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, |
47 int* exit_code); | 45 int* exit_code); |
48 | 46 |
49 // These are the command codes used on the wire between the browser and the | 47 // These are the command codes used on the wire between the browser and the |
50 // zygote. | 48 // zygote. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 base::Lock control_lock_; | 89 base::Lock control_lock_; |
92 pid_t pid_; | 90 pid_t pid_; |
93 bool init_; | 91 bool init_; |
94 bool using_suid_sandbox_; | 92 bool using_suid_sandbox_; |
95 std::string sandbox_binary_; | 93 std::string sandbox_binary_; |
96 bool have_read_sandbox_status_word_; | 94 bool have_read_sandbox_status_word_; |
97 int sandbox_status_; | 95 int sandbox_status_; |
98 }; | 96 }; |
99 | 97 |
100 #endif // CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ | 98 #endif // CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ |
OLD | NEW |