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 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 5 #ifndef CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 6 #define CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 16 matching lines...) Expand all Loading... |
27 | 27 |
28 void Init(const std::string& sandbox_cmd); | 28 void Init(const std::string& sandbox_cmd); |
29 | 29 |
30 // After the last known Zygote child exits, notify the Zygote to exit. | 30 // After the last known Zygote child exits, notify the Zygote to exit. |
31 void TearDownAfterLastChild(); | 31 void TearDownAfterLastChild(); |
32 | 32 |
33 // Tries to start a process of type indicated by process_type. | 33 // Tries to start a process of type indicated by process_type. |
34 // Returns its pid on success, otherwise | 34 // Returns its pid on success, otherwise |
35 // base::kNullProcessHandle; | 35 // base::kNullProcessHandle; |
36 pid_t ForkRequest(const std::vector<std::string>& command_line, | 36 pid_t ForkRequest(const std::vector<std::string>& command_line, |
37 const std::vector<FileDescriptorInfo>& mapping, | 37 scoped_ptr<FileDescriptorInfo> mapping, |
38 const std::string& process_type); | 38 const std::string& process_type); |
39 void EnsureProcessTerminated(pid_t process); | 39 void EnsureProcessTerminated(pid_t process); |
40 | 40 |
41 // Get the termination status (and, optionally, the exit code) of | 41 // Get the termination status (and, optionally, the exit code) of |
42 // 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 |
43 // process. (|exit_code| may be NULL.) | 43 // process. (|exit_code| may be NULL.) |
44 // Unfortunately the Zygote can not accurately figure out if a process | 44 // Unfortunately the Zygote can not accurately figure out if a process |
45 // is already dead without waiting synchronously for it. | 45 // is already dead without waiting synchronously for it. |
46 // |known_dead| should be set to true when we already know that the process | 46 // |known_dead| should be set to true when we already know that the process |
47 // is dead. When |known_dead| is false, processes could be seen as | 47 // is dead. When |known_dead| is false, processes could be seen as |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 // A lock protecting list_of_running_zygote_children_ and | 96 // A lock protecting list_of_running_zygote_children_ and |
97 // should_teardown_after_last_child_exits_. | 97 // should_teardown_after_last_child_exits_. |
98 base::Lock child_tracking_lock_; | 98 base::Lock child_tracking_lock_; |
99 std::set<pid_t> list_of_running_zygote_children_; | 99 std::set<pid_t> list_of_running_zygote_children_; |
100 bool should_teardown_after_last_child_exits_; | 100 bool should_teardown_after_last_child_exits_; |
101 }; | 101 }; |
102 | 102 |
103 } // namespace content | 103 } // namespace content |
104 | 104 |
105 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ | 105 #endif // CONTENT_BROWSER_ZYGOTE_HOST_ZYGOTE_HOST_IMPL_LINUX_H_ |
OLD | NEW |