Index: content/zygote/zygote_linux.cc |
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc |
index b5186734de8ef82449bec27c0c9a12e90a0d24ec..e74763289599aa5272388765c8d8d82113af7dc6 100644 |
--- a/content/zygote/zygote_linux.cc |
+++ b/content/zygote/zygote_linux.cc |
@@ -77,11 +77,14 @@ void KillAndReap(pid_t pid, ZygoteForkDelegate* helper) { |
} // namespace |
-Zygote::Zygote(int sandbox_flags, ScopedVector<ZygoteForkDelegate> helpers) |
+Zygote::Zygote(int sandbox_flags, ScopedVector<ZygoteForkDelegate> helpers, |
+ const std::vector<base::ProcessHandle>& extra_children, |
+ const std::vector<int>& extra_fds) |
: sandbox_flags_(sandbox_flags), |
helpers_(helpers.Pass()), |
- initial_uma_index_(0) { |
-} |
+ initial_uma_index_(0), |
+ extra_children_(extra_children), |
+ extra_fds_(extra_fds) {} |
Zygote::~Zygote() { |
} |
@@ -147,6 +150,13 @@ bool Zygote::HandleRequestFromBrowser(int fd) { |
if (len == 0 || (len == -1 && errno == ECONNRESET)) { |
// EOF from the browser. We should die. |
earthdok
2014/05/27 12:50:12
Note to self: call __asan_cov_dump() to dump cover
|
+ for (std::vector<int>::iterator it = extra_fds_.begin(); |
jln (very slow on Chromium)
2014/05/27 23:15:00
Would you mind adding a TODO(earthdok) to replace
earthdok
2014/05/28 16:44:51
I was planning to add the call as part of this CL,
jln (very slow on Chromium)
2014/05/29 23:29:19
Yeah, it would be nice to get rid of extra_fds_.
|
+ it < extra_fds_.end(); it++) |
jln (very slow on Chromium)
2014/05/27 23:15:00
Style: always use {} for multi-line if/for
jln (very slow on Chromium)
2014/05/27 23:15:00
Nit: ++it is more idiomatic than it++ as it never
earthdok
2014/05/28 16:44:51
Done.
earthdok
2014/05/28 16:44:51
Done.
|
+ PCHECK(0 == IGNORE_EINTR(close(*it))); |
+ for (std::vector<base::ProcessHandle>::iterator it = |
+ extra_children_.begin(); |
+ it < extra_children_.end(); it++) |
jln (very slow on Chromium)
2014/05/27 23:15:00
Style: {}
jln (very slow on Chromium)
2014/05/27 23:15:00
Nit: ++it
earthdok
2014/05/28 16:44:51
Done.
earthdok
2014/05/28 16:44:51
Done.
|
+ PCHECK(*it == HANDLE_EINTR(waitpid(*it, NULL, 0))); |
jln (very slow on Chromium)
2014/05/27 23:15:00
I'm a little scared of the implicit requirement th
earthdok
2014/05/28 16:44:51
Like I said, I'm willing to implement the watchdog
jln (very slow on Chromium)
2014/05/29 23:29:19
I wonder if we could simply use base::Watchdog for
|
_exit(0); |
return false; |
} |