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

Unified Diff: content/browser/renderer_host/render_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/renderer_host/render_process_host_impl.cc
diff --git a/content/browser/renderer_host/render_process_host_impl.cc b/content/browser/renderer_host/render_process_host_impl.cc
index 3c9bde2e1179770853ac4144794a5a5407f23ca9..610e2a344e39da8957a116312f23f2fd8ae76045 100644
--- a/content/browser/renderer_host/render_process_host_impl.cc
+++ b/content/browser/renderer_host/render_process_host_impl.cc
@@ -201,12 +201,6 @@
#include "content/browser/mach_broker_mac.h"
#endif
-#if defined(OS_POSIX)
-#include "content/browser/zygote_host/zygote_communication_linux.h"
-#include "content/browser/zygote_host/zygote_host_impl_linux.h"
-#include "content/public/browser/zygote_handle_linux.h"
-#endif // defined(OS_POSIX)
-
#if defined(USE_OZONE)
#include "ui/ozone/public/client_native_pixmap_factory.h"
#include "ui/ozone/public/ozone_platform.h"
@@ -368,12 +362,6 @@
return map;
}
-#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
-// This static member variable holds the zygote communication information for
-// the renderer.
-ZygoteHandle g_render_zygote;
-#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
-
// NOTE: changes to this class need to be reviewed by the security team.
class RendererSandboxedProcessLauncherDelegate
: public SandboxedProcessLauncherDelegate {
@@ -401,17 +389,13 @@
}
#elif defined(OS_POSIX)
-#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
- ZygoteHandle* GetZygote() override {
+ bool ShouldUseZygote() override {
const base::CommandLine& browser_command_line =
*base::CommandLine::ForCurrentProcess();
base::CommandLine::StringType renderer_prefix =
browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix);
- if (!renderer_prefix.empty())
- return nullptr;
- return &g_render_zygote;
- }
-#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
+ return renderer_prefix.empty();
+ }
base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
@@ -540,19 +524,6 @@
void RenderProcessHost::SetMaxRendererProcessCount(size_t count) {
g_max_renderer_count_override = count;
}
-
-#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
-// static
-void RenderProcessHostImpl::EarlyZygoteLaunch() {
- DCHECK(!g_render_zygote);
- g_render_zygote = CreateZygote();
- // TODO(kerrnel): Investigate doing this without the ZygoteHostImpl as a
- // proxy. It is currently done this way due to concerns about race
- // conditions.
- ZygoteHostImpl::GetInstance()->SetRendererSandboxStatus(
- g_render_zygote->GetSandboxStatus());
-}
-#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
RenderProcessHostImpl::RenderProcessHostImpl(
BrowserContext* browser_context,
« no previous file with comments | « content/browser/renderer_host/render_process_host_impl.h ('k') | content/browser/utility_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698