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_PUBLIC_COMMON_ZYGOTE_FORK_DELEGATE_LINUX_H_ | 5 #ifndef CONTENT_PUBLIC_COMMON_ZYGOTE_FORK_DELEGATE_LINUX_H_ |
6 #define CONTENT_PUBLIC_COMMON_ZYGOTE_FORK_DELEGATE_LINUX_H_ | 6 #define CONTENT_PUBLIC_COMMON_ZYGOTE_FORK_DELEGATE_LINUX_H_ |
7 | 7 |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 15 matching lines...) Expand all Loading... |
26 // alternative to forking the zygote. A new delegate is passed in | 26 // alternative to forking the zygote. A new delegate is passed in |
27 // as an argument to ZygoteMain(). | 27 // as an argument to ZygoteMain(). |
28 virtual ~ZygoteForkDelegate() {} | 28 virtual ~ZygoteForkDelegate() {} |
29 | 29 |
30 // Initialization happens in the zygote after it has been | 30 // Initialization happens in the zygote after it has been |
31 // started by ZygoteMain. | 31 // started by ZygoteMain. |
32 // If |enable_layer1_sandbox| is true, the delegate must enable a | 32 // If |enable_layer1_sandbox| is true, the delegate must enable a |
33 // layer-1 sandbox such as the setuid sandbox. | 33 // layer-1 sandbox such as the setuid sandbox. |
34 virtual void Init(int sandboxdesc, bool enable_layer1_sandbox) = 0; | 34 virtual void Init(int sandboxdesc, bool enable_layer1_sandbox) = 0; |
35 | 35 |
36 // After Init, supply a UMA_HISTOGRAM_ENUMERATION the delegate | 36 // After Init, supply a UMA_HISTOGRAM_ENUMERATION the delegate would like |
37 // would like to supply on the first fork. | 37 // reported to the browser process. (Note: Because these reports are |
| 38 // piggy-backed onto fork responses that don't otherwise contain UMA reports, |
| 39 // this method may not be called until much later.) |
38 virtual void InitialUMA(std::string* uma_name, | 40 virtual void InitialUMA(std::string* uma_name, |
39 int* uma_sample, | 41 int* uma_sample, |
40 int* uma_boundary_value) = 0; | 42 int* uma_boundary_value) = 0; |
41 | 43 |
42 // Returns 'true' if the delegate would like to handle a given fork | 44 // Returns 'true' if the delegate would like to handle a given fork |
43 // request. Otherwise returns false. Optionally, fills in uma_name et al | 45 // request. Otherwise returns false. Optionally, fills in uma_name et al |
44 // with a report the helper wants to make via UMA_HISTOGRAM_ENUMERATION. | 46 // with a report the helper wants to make via UMA_HISTOGRAM_ENUMERATION. |
45 virtual bool CanHelp(const std::string& process_type, std::string* uma_name, | 47 virtual bool CanHelp(const std::string& process_type, std::string* uma_name, |
46 int* uma_sample, int* uma_boundary_value) = 0; | 48 int* uma_sample, int* uma_boundary_value) = 0; |
47 | 49 |
(...skipping 27 matching lines...) Expand all Loading... |
75 // blocking wait() should be performed. In this case, GetTerminationStatus() | 77 // blocking wait() should be performed. In this case, GetTerminationStatus() |
76 // will send a SIGKILL to the target process first. | 78 // will send a SIGKILL to the target process first. |
77 virtual bool GetTerminationStatus(pid_t pid, bool known_dead, | 79 virtual bool GetTerminationStatus(pid_t pid, bool known_dead, |
78 base::TerminationStatus* status, | 80 base::TerminationStatus* status, |
79 int* exit_code) = 0; | 81 int* exit_code) = 0; |
80 }; | 82 }; |
81 | 83 |
82 } // namespace content | 84 } // namespace content |
83 | 85 |
84 #endif // CONTENT_PUBLIC_COMMON_ZYGOTE_FORK_DELEGATE_LINUX_H_ | 86 #endif // CONTENT_PUBLIC_COMMON_ZYGOTE_FORK_DELEGATE_LINUX_H_ |
OLD | NEW |