Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1201)

Side by Side Diff: content/zygote/zygote_linux.h

Issue 269543014: Use RecvMsgWithPid to find real PID for zygote children (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Respond to jln feedback Created 6 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after
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. Optionally, it
79 // fills in uma_name et al with a report the helper wants to make via 79 // fills in uma_name et al with a report the helper wants to make via
80 // UMA_HISTOGRAM_ENUMERATION. 80 // UMA_HISTOGRAM_ENUMERATION.
jln (very slow on Chromium) 2014/05/05 19:01:42 It's a little unfortunately that this method is so
mdempsky 2014/05/05 21:38:18 Done. Tried to improve the uma_* docs a little bi
81 int ForkWithRealPid(const std::string& process_type, 81 int ForkWithRealPid(const std::string& process_type,
82 const base::GlobalDescriptors::Mapping& fd_mapping, 82 const base::GlobalDescriptors::Mapping& fd_mapping,
83 const std::string& channel_id, 83 const std::string& channel_id,
84 base::ScopedFD pid_oracle,
84 std::string* uma_name, 85 std::string* uma_name,
85 int* uma_sample, 86 int* uma_sample,
86 int* uma_boundary_value); 87 int* uma_boundary_value);
87 88
88 // Unpacks process type and arguments from |pickle| and forks a new process. 89 // 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 90 // 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(). 91 // process and the child process ID to the parent process, like fork().
91 base::ProcessId ReadArgsAndFork(const Pickle& pickle, 92 base::ProcessId ReadArgsAndFork(const Pickle& pickle,
92 PickleIterator iter, 93 PickleIterator iter,
93 ScopedVector<base::ScopedFD> fds, 94 ScopedVector<base::ScopedFD> fds,
(...skipping 26 matching lines...) Expand all
120 // 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
121 // sample we should report on the first fork. 122 // sample we should report on the first fork.
122 std::string initial_uma_name_; 123 std::string initial_uma_name_;
123 int initial_uma_sample_; 124 int initial_uma_sample_;
124 int initial_uma_boundary_value_; 125 int initial_uma_boundary_value_;
125 }; 126 };
126 127
127 } // namespace content 128 } // namespace content
128 129
129 #endif // CONTENT_ZYGOTE_ZYGOTE_H_ 130 #endif // CONTENT_ZYGOTE_ZYGOTE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698