OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_ZYGOTE_COMMUNICATION_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ |
6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ | 6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ |
7 | 7 |
| 8 #include <memory> |
8 #include <set> | 9 #include <set> |
9 #include <vector> | 10 #include <vector> |
10 | 11 |
11 #include "base/memory/scoped_ptr.h" | |
12 #include "base/process/kill.h" | 12 #include "base/process/kill.h" |
13 #include "base/synchronization/lock.h" | 13 #include "base/synchronization/lock.h" |
14 #include "content/common/content_export.h" | 14 #include "content/common/content_export.h" |
15 #include "content/public/browser/file_descriptor_info.h" | 15 #include "content/public/browser/file_descriptor_info.h" |
16 | 16 |
17 namespace content { | 17 namespace content { |
18 | 18 |
19 class CONTENT_EXPORT ZygoteCommunication { | 19 class CONTENT_EXPORT ZygoteCommunication { |
20 public: | 20 public: |
21 ZygoteCommunication(); | 21 ZygoteCommunication(); |
22 ~ZygoteCommunication(); | 22 ~ZygoteCommunication(); |
23 | 23 |
24 void Init(); | 24 void Init(); |
25 | 25 |
26 // Tries to start a process of type indicated by process_type. | 26 // Tries to start a process of type indicated by process_type. |
27 // Returns its pid on success, otherwise base::kNullProcessHandle; | 27 // Returns its pid on success, otherwise base::kNullProcessHandle; |
28 pid_t ForkRequest(const std::vector<std::string>& command_line, | 28 pid_t ForkRequest(const std::vector<std::string>& command_line, |
29 scoped_ptr<FileDescriptorInfo> mapping, | 29 std::unique_ptr<FileDescriptorInfo> mapping, |
30 const std::string& process_type); | 30 const std::string& process_type); |
31 | 31 |
32 void EnsureProcessTerminated(pid_t process); | 32 void EnsureProcessTerminated(pid_t process); |
33 | 33 |
34 // Should be called every time a Zygote child died. | 34 // Should be called every time a Zygote child died. |
35 void ZygoteChildDied(pid_t process); | 35 void ZygoteChildDied(pid_t process); |
36 | 36 |
37 // Get the termination status (and, optionally, the exit code) of | 37 // Get the termination status (and, optionally, the exit code) of |
38 // the process. |exit_code| is set to the exit code of the child | 38 // the process. |exit_code| is set to the exit code of the child |
39 // process. (|exit_code| may be NULL.) | 39 // process. (|exit_code| may be NULL.) |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 int sandbox_status_; | 84 int sandbox_status_; |
85 bool have_read_sandbox_status_word_; | 85 bool have_read_sandbox_status_word_; |
86 bool use_suid_sandbox_for_adj_oom_score_; | 86 bool use_suid_sandbox_for_adj_oom_score_; |
87 // Set to true when the zygote is initialized successfully. | 87 // Set to true when the zygote is initialized successfully. |
88 bool init_; | 88 bool init_; |
89 }; | 89 }; |
90 | 90 |
91 } // namespace content | 91 } // namespace content |
92 | 92 |
93 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ | 93 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_COMMUNICATION_LINUX_H_ |
OLD | NEW |