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

Unified Diff: content/zygote/zygote_linux.cc

Issue 809243002: Use ForkWithFlags on the zygote. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Explain reasons for using ForkWithFlags. Created 6 years 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/zygote/zygote_linux.cc
diff --git a/content/zygote/zygote_linux.cc b/content/zygote/zygote_linux.cc
index bd642216b1158466f6acc806a885ade583fcb045..0d1fa73fa71cb182640f9d2fdba78b1e65646faa 100644
--- a/content/zygote/zygote_linux.cc
+++ b/content/zygote/zygote_linux.cc
@@ -33,6 +33,7 @@
#include "content/public/common/zygote_fork_delegate_linux.h"
#include "ipc/ipc_channel.h"
#include "ipc/ipc_switches.h"
+#include "sandbox/linux/services/syscall_wrappers.h"
#if defined(ADDRESS_SANITIZER)
#include <sanitizer/asan_interface.h>
@@ -374,7 +375,9 @@ int Zygote::ForkWithRealPid(const std::string& process_type,
CHECK_NE(pid, 0);
} else {
CreatePipe(&read_pipe, &write_pipe);
- pid = fork();
+ // This is roughly equivalent to a fork(). We are using ForkWithFlags mainly
+ // to give it some more diverse test coverage.
+ pid = sandbox::ForkWithFlags(SIGCHLD, nullptr, nullptr);
}
if (pid == 0) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698