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

Unified Diff: content/browser/utility_process_host_impl.cc

Issue 1532423003: Have each SandboxedProcessLauncherDelegate maintain a zygote. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/browser/utility_process_host_impl.cc
diff --git a/content/browser/utility_process_host_impl.cc b/content/browser/utility_process_host_impl.cc
index 3b7891f0c1f538beaa059c5b9b04f85e78fd4547..50d0217789b0fbeb6baec12ffe52b82a47d9cc19 100644
--- a/content/browser/utility_process_host_impl.cc
+++ b/content/browser/utility_process_host_impl.cc
@@ -58,7 +58,9 @@ class UtilitySandboxedProcessLauncherDelegate
launch_elevated_(launch_elevated)
#elif defined(OS_POSIX)
env_(env),
+#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
no_sandbox_(no_sandbox),
+#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
ipc_fd_(host->TakeClientFileDescriptor())
#endif // OS_WIN
{}
@@ -88,9 +90,14 @@ class UtilitySandboxedProcessLauncherDelegate
#elif defined(OS_POSIX)
- bool ShouldUseZygote() override {
- return !no_sandbox_ && exposed_dir_.empty();
+#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
+ ZygoteHandle* GetZygote() override {
+ if (no_sandbox_ || !exposed_dir_.empty())
+ return nullptr;
+ static ZygoteHandle zygote;
+ return &zygote;
}
+#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
base::EnvironmentMap GetEnvironment() override { return env_; }
base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
@@ -106,7 +113,9 @@ class UtilitySandboxedProcessLauncherDelegate
bool launch_elevated_;
#elif defined(OS_POSIX)
base::EnvironmentMap env_;
+#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
bool no_sandbox_;
+#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
base::ScopedFD ipc_fd_;
#endif // OS_WIN
};

Powered by Google App Engine
This is Rietveld 408576698