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_H_ | 5 #ifndef CONTENT_ZYGOTE_ZYGOTE_H_ |
6 #define CONTENT_ZYGOTE_ZYGOTE_H_ | 6 #define CONTENT_ZYGOTE_ZYGOTE_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 struct ZygoteProcessInfo { | 37 struct ZygoteProcessInfo { |
38 // Pid from inside the Zygote's PID namespace. | 38 // Pid from inside the Zygote's PID namespace. |
39 base::ProcessHandle internal_pid; | 39 base::ProcessHandle internal_pid; |
40 // Keeps track of whether or not a process was started from a fork | 40 // Keeps track of whether or not a process was started from a fork |
41 // delegate helper. | 41 // delegate helper. |
42 bool started_from_helper; | 42 bool started_from_helper; |
43 }; | 43 }; |
44 typedef base::SmallMap< std::map<base::ProcessHandle, ZygoteProcessInfo> > | 44 typedef base::SmallMap< std::map<base::ProcessHandle, ZygoteProcessInfo> > |
45 ZygoteProcessMap; | 45 ZygoteProcessMap; |
46 | 46 |
| 47 // Retrieve a ZygoteProcessInfo from the process_info_map_. |
| 48 // Returns true and write to process_info if |pid| can be found, return |
| 49 // false otherwise. |
| 50 bool GetProcessInfo(base::ProcessHandle pid, |
| 51 ZygoteProcessInfo* process_info); |
| 52 |
47 // Returns true if the SUID sandbox is active. | 53 // Returns true if the SUID sandbox is active. |
48 bool UsingSUIDSandbox() const; | 54 bool UsingSUIDSandbox() const; |
49 | 55 |
50 // --------------------------------------------------------------------------- | 56 // --------------------------------------------------------------------------- |
51 // Requests from the browser... | 57 // Requests from the browser... |
52 | 58 |
53 // Read and process a request from the browser. Returns true if we are in a | 59 // Read and process a request from the browser. Returns true if we are in a |
54 // new process and thus need to unwind back into ChromeMain. | 60 // new process and thus need to unwind back into ChromeMain. |
55 bool HandleRequestFromBrowser(int fd); | 61 bool HandleRequestFromBrowser(int fd); |
56 | 62 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // These might be set by helper_->InitialUMA. They supply a UMA enumeration | 121 // These might be set by helper_->InitialUMA. They supply a UMA enumeration |
116 // sample we should report on the first fork. | 122 // sample we should report on the first fork. |
117 std::string initial_uma_name_; | 123 std::string initial_uma_name_; |
118 int initial_uma_sample_; | 124 int initial_uma_sample_; |
119 int initial_uma_boundary_value_; | 125 int initial_uma_boundary_value_; |
120 }; | 126 }; |
121 | 127 |
122 } // namespace content | 128 } // namespace content |
123 | 129 |
124 #endif // CONTENT_ZYGOTE_ZYGOTE_H_ | 130 #endif // CONTENT_ZYGOTE_ZYGOTE_H_ |
OLD | NEW |