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 |
11 #include "base/containers/small_map.h" | 11 #include "base/containers/small_map.h" |
| 12 #include "base/posix/global_descriptors.h" |
12 #include "base/process/kill.h" | 13 #include "base/process/kill.h" |
13 #include "base/process/process.h" | 14 #include "base/process/process.h" |
14 | 15 |
15 class Pickle; | 16 class Pickle; |
16 class PickleIterator; | 17 class PickleIterator; |
17 | 18 |
18 namespace content { | 19 namespace content { |
19 | 20 |
20 class ZygoteForkDelegate; | 21 class ZygoteForkDelegate; |
21 | 22 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
70 void HandleGetTerminationStatus(int fd, | 71 void HandleGetTerminationStatus(int fd, |
71 const Pickle& pickle, | 72 const Pickle& pickle, |
72 PickleIterator iter); | 73 PickleIterator iter); |
73 | 74 |
74 // This is equivalent to fork(), except that, when using the SUID sandbox, it | 75 // This is equivalent to fork(), except that, when using the SUID sandbox, it |
75 // returns the real PID of the child process as it appears outside the | 76 // returns the real PID of the child process as it appears outside the |
76 // sandbox, rather than returning the PID inside the sandbox. Optionally, it | 77 // sandbox, rather than returning the PID inside the sandbox. Optionally, it |
77 // fills in uma_name et al with a report the helper wants to make via | 78 // fills in uma_name et al with a report the helper wants to make via |
78 // UMA_HISTOGRAM_ENUMERATION. | 79 // UMA_HISTOGRAM_ENUMERATION. |
79 int ForkWithRealPid(const std::string& process_type, | 80 int ForkWithRealPid(const std::string& process_type, |
80 std::vector<int>& fds, | 81 const base::GlobalDescriptors::Mapping& fd_mapping, |
81 const std::string& channel_switch, | 82 const std::string& channel_switch, |
82 std::string* uma_name, | 83 std::string* uma_name, |
83 int* uma_sample, | 84 int* uma_sample, |
84 int* uma_boundary_value); | 85 int* uma_boundary_value); |
85 | 86 |
86 // Unpacks process type and arguments from |pickle| and forks a new process. | 87 // Unpacks process type and arguments from |pickle| and forks a new process. |
87 // Returns -1 on error, otherwise returns twice, returning 0 to the child | 88 // Returns -1 on error, otherwise returns twice, returning 0 to the child |
88 // process and the child process ID to the parent process, like fork(). | 89 // process and the child process ID to the parent process, like fork(). |
89 base::ProcessId ReadArgsAndFork(const Pickle& pickle, | 90 base::ProcessId ReadArgsAndFork(const Pickle& pickle, |
90 PickleIterator iter, | 91 PickleIterator iter, |
(...skipping 27 matching lines...) Expand all Loading... |
118 // These might be set by helper_->InitialUMA. They supply a UMA enumeration | 119 // These might be set by helper_->InitialUMA. They supply a UMA enumeration |
119 // sample we should report on the first fork. | 120 // sample we should report on the first fork. |
120 std::string initial_uma_name_; | 121 std::string initial_uma_name_; |
121 int initial_uma_sample_; | 122 int initial_uma_sample_; |
122 int initial_uma_boundary_value_; | 123 int initial_uma_boundary_value_; |
123 }; | 124 }; |
124 | 125 |
125 } // namespace content | 126 } // namespace content |
126 | 127 |
127 #endif // CONTENT_ZYGOTE_ZYGOTE_H_ | 128 #endif // CONTENT_ZYGOTE_ZYGOTE_H_ |
OLD | NEW |