OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 renderer process. Returns its pid on success, otherwise | 35 // Tries to start a process of type indicated by process_type. |
| 36 // Returns its pid on success, otherwise |
36 // base::kNullProcessHandle; | 37 // base::kNullProcessHandle; |
37 pid_t ForkRenderer(const std::vector<std::string>& command_line, | 38 pid_t ForkRequest(const std::vector<std::string>& command_line, |
38 const base::GlobalDescriptors::Mapping& mapping); | 39 const base::GlobalDescriptors::Mapping& mapping, |
| 40 const std::string& process_type); |
39 void EnsureProcessTerminated(pid_t process); | 41 void EnsureProcessTerminated(pid_t process); |
40 | 42 |
41 // Get the termination status (and, optionally, the exit code) of | 43 // Get the termination status (and, optionally, the exit code) of |
42 // the process. |exit_code| is set to the exit code of the child | 44 // the process. |exit_code| is set to the exit code of the child |
43 // process. (|exit_code| may be NULL.) | 45 // process. (|exit_code| may be NULL.) |
44 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, | 46 base::TerminationStatus GetTerminationStatus(base::ProcessHandle handle, |
45 int* exit_code); | 47 int* exit_code); |
46 | 48 |
47 // These are the command codes used on the wire between the browser and the | 49 // These are the command codes used on the wire between the browser and the |
48 // zygote. | 50 // zygote. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 base::Lock control_lock_; | 91 base::Lock control_lock_; |
90 pid_t pid_; | 92 pid_t pid_; |
91 bool init_; | 93 bool init_; |
92 bool using_suid_sandbox_; | 94 bool using_suid_sandbox_; |
93 std::string sandbox_binary_; | 95 std::string sandbox_binary_; |
94 bool have_read_sandbox_status_word_; | 96 bool have_read_sandbox_status_word_; |
95 int sandbox_status_; | 97 int sandbox_status_; |
96 }; | 98 }; |
97 | 99 |
98 #endif // CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ | 100 #endif // CONTENT_BROWSER_ZYGOTE_HOST_LINUX_H_ |
OLD | NEW |