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_ZYGOTE_ZYGOTE_LINUX_H_ | 5 #ifndef CONTENT_ZYGOTE_ZYGOTE_LINUX_H_ |
6 #define CONTENT_ZYGOTE_ZYGOTE_LINUX_H_ | 6 #define CONTENT_ZYGOTE_ZYGOTE_LINUX_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include <memory> | 10 #include <memory> |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 struct ZygoteProcessInfo { | 44 struct ZygoteProcessInfo { |
45 // Pid from inside the Zygote's PID namespace. | 45 // Pid from inside the Zygote's PID namespace. |
46 base::ProcessHandle internal_pid; | 46 base::ProcessHandle internal_pid; |
47 // Keeps track of which fork delegate helper the process was started from. | 47 // Keeps track of which fork delegate helper the process was started from. |
48 ZygoteForkDelegate* started_from_helper; | 48 ZygoteForkDelegate* started_from_helper; |
49 // Records when the browser requested the zygote to reap this process. | 49 // Records when the browser requested the zygote to reap this process. |
50 base::TimeTicks time_of_reap_request; | 50 base::TimeTicks time_of_reap_request; |
51 // Notes whether the zygote has sent SIGKILL to this process. | 51 // Notes whether the zygote has sent SIGKILL to this process. |
52 bool sent_sigkill; | 52 bool sent_sigkill; |
53 }; | 53 }; |
54 typedef base::SmallMap< std::map<base::ProcessHandle, ZygoteProcessInfo> > | 54 using ZygoteProcessMap = |
55 ZygoteProcessMap; | 55 base::small_map<std::map<base::ProcessHandle, ZygoteProcessInfo>>; |
56 | 56 |
57 // Retrieve a ZygoteProcessInfo from the process_info_map_. | 57 // Retrieve a ZygoteProcessInfo from the process_info_map_. |
58 // Returns true and write to process_info if |pid| can be found, return | 58 // Returns true and write to process_info if |pid| can be found, return |
59 // false otherwise. | 59 // false otherwise. |
60 bool GetProcessInfo(base::ProcessHandle pid, | 60 bool GetProcessInfo(base::ProcessHandle pid, ZygoteProcessInfo* process_info); |
61 ZygoteProcessInfo* process_info); | |
62 | 61 |
63 // Returns true if the SUID sandbox is active. | 62 // Returns true if the SUID sandbox is active. |
64 bool UsingSUIDSandbox() const; | 63 bool UsingSUIDSandbox() const; |
65 // Returns true if the NS sandbox is active. | 64 // Returns true if the NS sandbox is active. |
66 bool UsingNSSandbox() const; | 65 bool UsingNSSandbox() const; |
67 | 66 |
68 // --------------------------------------------------------------------------- | 67 // --------------------------------------------------------------------------- |
69 // Requests from the browser... | 68 // Requests from the browser... |
70 | 69 |
71 // Read and process a request from the browser. Returns true if we are in a | 70 // Read and process a request from the browser. Returns true if we are in a |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 // children. | 151 // children. |
153 std::vector<int> extra_fds_; | 152 std::vector<int> extra_fds_; |
154 | 153 |
155 // The vector contains the child processes that need to be reaped. | 154 // The vector contains the child processes that need to be reaped. |
156 std::vector<ZygoteProcessInfo> to_reap_; | 155 std::vector<ZygoteProcessInfo> to_reap_; |
157 }; | 156 }; |
158 | 157 |
159 } // namespace content | 158 } // namespace content |
160 | 159 |
161 #endif // CONTENT_ZYGOTE_ZYGOTE_LINUX_H_ | 160 #endif // CONTENT_ZYGOTE_ZYGOTE_LINUX_H_ |
OLD | NEW |