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

Unified Diff: content/browser/utility_process_host_impl.cc

Issue 1617213002: Revert of 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 447685a3382e8310ab61e8c4044c1dc5c34b0d9f..db67d60dc225e1c161e818315153975801596476 100644
--- a/content/browser/utility_process_host_impl.cc
+++ b/content/browser/utility_process_host_impl.cc
@@ -37,22 +37,12 @@
#include "ipc/ipc_switches.h"
#include "ui/base/ui_base_switches.h"
-#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
-#include "content/public/browser/zygote_handle_linux.h"
-#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
-
#if defined(OS_WIN)
#include "sandbox/win/src/sandbox_policy.h"
#include "sandbox/win/src/sandbox_types.h"
#endif
namespace content {
-
-#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
-namespace {
-ZygoteHandle g_utility_zygote;
-} // namespace
-#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
// NOTE: changes to this class need to be reviewed by the security team.
class UtilitySandboxedProcessLauncherDelegate
@@ -68,9 +58,7 @@
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
{}
@@ -100,13 +88,9 @@
#elif defined(OS_POSIX)
-#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
- ZygoteHandle* GetZygote() override {
- if (no_sandbox_ || !exposed_dir_.empty())
- return nullptr;
- return &g_utility_zygote;
- }
-#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
+ bool ShouldUseZygote() override {
+ return !no_sandbox_ && exposed_dir_.empty();
+ }
base::EnvironmentMap GetEnvironment() override { return env_; }
base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
@@ -122,9 +106,7 @@
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
};
@@ -237,14 +219,6 @@
void UtilityProcessHostImpl::SetName(const base::string16& name) {
name_ = name;
}
-
-#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
-// static
-void UtilityProcessHostImpl::EarlyZygoteLaunch() {
- DCHECK(!g_utility_zygote);
- g_utility_zygote = CreateZygote();
-}
-#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
bool UtilityProcessHostImpl::StartProcess() {
if (started_)
« no previous file with comments | « content/browser/utility_process_host_impl.h ('k') | content/browser/zygote_host/zygote_communication_linux.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698