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

Unified Diff: content/zygote/zygote_main_linux.cc

Issue 269413004: Add support for multiple zygote fork delegates (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: IWYU 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
« no previous file with comments | « content/zygote/zygote_main.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/zygote/zygote_main_linux.cc
diff --git a/content/zygote/zygote_main_linux.cc b/content/zygote/zygote_main_linux.cc
index 11f06022d1fb3e5f58bb470b5dae174dcb9ee026..123296907cef7d634ac3ca6f253323b0f01ef270 100644
--- a/content/zygote/zygote_main_linux.cc
+++ b/content/zygote/zygote_main_linux.cc
@@ -21,6 +21,7 @@
#include "base/command_line.h"
#include "base/compiler_specific.h"
#include "base/linux_util.h"
+#include "base/memory/scoped_vector.h"
#include "base/native_library.h"
#include "base/pickle.h"
#include "base/posix/eintr_wrapper.h"
@@ -442,7 +443,7 @@ static void EnterLayerOneSandbox(LinuxSandbox* linux_sandbox,
}
bool ZygoteMain(const MainFunctionParams& params,
- ZygoteForkDelegate* forkdelegate) {
+ ScopedVector<ZygoteForkDelegate> fork_delegates) {
g_am_zygote_or_renderer = true;
sandbox::InitLibcUrandomOverrides();
@@ -462,11 +463,12 @@ bool ZygoteMain(const MainFunctionParams& params,
std::vector<int>()));
}
- if (forkdelegate != NULL) {
- VLOG(1) << "ZygoteMain: initializing fork delegate";
- forkdelegate->Init(GetSandboxFD(), must_enable_setuid_sandbox);
- } else {
- VLOG(1) << "ZygoteMain: fork delegate is NULL";
+ VLOG(1) << "ZygoteMain: initializing " << fork_delegates.size()
+ << " fork delegates";
+ for (ScopedVector<ZygoteForkDelegate>::iterator i = fork_delegates.begin();
+ i != fork_delegates.end();
+ ++i) {
+ (*i)->Init(GetSandboxFD(), must_enable_setuid_sandbox);
}
// Turn on the first layer of the sandbox if the configuration warrants it.
@@ -476,7 +478,7 @@ bool ZygoteMain(const MainFunctionParams& params,
bool setuid_sandbox_engaged = sandbox_flags & kSandboxLinuxSUID;
CHECK_EQ(must_enable_setuid_sandbox, setuid_sandbox_engaged);
- Zygote zygote(sandbox_flags, forkdelegate);
+ Zygote zygote(sandbox_flags, fork_delegates.Pass());
// This function call can return multiple times, once per fork().
return zygote.ProcessRequests();
}
« no previous file with comments | « content/zygote/zygote_main.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698