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

Unified Diff: content/zygote/zygote_linux.cc

Issue 280303002: Add sandbox support for AsanCoverage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: helper exits on 0 bytes received, zygote waits on it 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 side-by-side diff with in-line comments
Download patch
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;
}

Powered by Google App Engine
This is Rietveld 408576698