| 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 | 9 |
| 10 #include "base/containers/small_map.h" | 10 #include "base/containers/small_map.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 bool GetTerminationStatus(base::ProcessHandle real_pid, bool known_dead, | 68 bool GetTerminationStatus(base::ProcessHandle real_pid, bool known_dead, |
| 69 base::TerminationStatus* status, | 69 base::TerminationStatus* status, |
| 70 int* exit_code); | 70 int* exit_code); |
| 71 | 71 |
| 72 void HandleGetTerminationStatus(int fd, | 72 void HandleGetTerminationStatus(int fd, |
| 73 const Pickle& pickle, | 73 const Pickle& pickle, |
| 74 PickleIterator iter); | 74 PickleIterator iter); |
| 75 | 75 |
| 76 // This is equivalent to fork(), except that, when using the SUID sandbox, it | 76 // This is equivalent to fork(), except that, when using the SUID sandbox, it |
| 77 // returns the real PID of the child process as it appears outside the | 77 // returns the real PID of the child process as it appears outside the |
| 78 // sandbox, rather than returning the PID inside the sandbox. Optionally, it | 78 // sandbox, rather than returning the PID inside the sandbox. The child's |
| 79 // fills in uma_name et al with a report the helper wants to make via | 79 // real PID is determined by having it call content::SendZygoteChildPing(int) |
| 80 // UMA_HISTOGRAM_ENUMERATION. | 80 // using the |pid_oracle| descriptor. |
| 81 // Finally, when using a ZygoteForkDelegate helper, |uma_name|, |uma_sample|, |
| 82 // and |uma_boundary_value| may be set if the helper wants to make a UMA |
| 83 // report via UMA_HISTOGRAM_ENUMERATION. |
| 81 int ForkWithRealPid(const std::string& process_type, | 84 int ForkWithRealPid(const std::string& process_type, |
| 82 const base::GlobalDescriptors::Mapping& fd_mapping, | 85 const base::GlobalDescriptors::Mapping& fd_mapping, |
| 83 const std::string& channel_id, | 86 const std::string& channel_id, |
| 87 base::ScopedFD pid_oracle, |
| 84 std::string* uma_name, | 88 std::string* uma_name, |
| 85 int* uma_sample, | 89 int* uma_sample, |
| 86 int* uma_boundary_value); | 90 int* uma_boundary_value); |
| 87 | 91 |
| 88 // Unpacks process type and arguments from |pickle| and forks a new process. | 92 // Unpacks process type and arguments from |pickle| and forks a new process. |
| 89 // Returns -1 on error, otherwise returns twice, returning 0 to the child | 93 // Returns -1 on error, otherwise returns twice, returning 0 to the child |
| 90 // process and the child process ID to the parent process, like fork(). | 94 // process and the child process ID to the parent process, like fork(). |
| 91 base::ProcessId ReadArgsAndFork(const Pickle& pickle, | 95 base::ProcessId ReadArgsAndFork(const Pickle& pickle, |
| 92 PickleIterator iter, | 96 PickleIterator iter, |
| 93 ScopedVector<base::ScopedFD> fds, | 97 ScopedVector<base::ScopedFD> fds, |
| (...skipping 26 matching lines...) Expand all Loading... |
| 120 // These might be set by helper_->InitialUMA. They supply a UMA enumeration | 124 // These might be set by helper_->InitialUMA. They supply a UMA enumeration |
| 121 // sample we should report on the first fork. | 125 // sample we should report on the first fork. |
| 122 std::string initial_uma_name_; | 126 std::string initial_uma_name_; |
| 123 int initial_uma_sample_; | 127 int initial_uma_sample_; |
| 124 int initial_uma_boundary_value_; | 128 int initial_uma_boundary_value_; |
| 125 }; | 129 }; |
| 126 | 130 |
| 127 } // namespace content | 131 } // namespace content |
| 128 | 132 |
| 129 #endif // CONTENT_ZYGOTE_ZYGOTE_H_ | 133 #endif // CONTENT_ZYGOTE_ZYGOTE_H_ |
| OLD | NEW |