| 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 83a4bd7d7381b6d11fd7cbfb095cdc3d0764e94c..e6f9e175d1602730bdd178b7a877417fdb2b8f43 100644
|
| --- a/content/browser/renderer_host/render_process_host_impl.cc
|
| +++ b/content/browser/renderer_host/render_process_host_impl.cc
|
| @@ -200,6 +200,11 @@
|
| #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"
|
| +#endif // defined(OS_POSIX)
|
| +
|
| #if defined(USE_OZONE)
|
| #include "ui/ozone/public/client_native_pixmap_factory.h"
|
| #include "ui/ozone/public/ozone_platform.h"
|
| @@ -388,13 +393,28 @@ class RendererSandboxedProcessLauncherDelegate
|
| }
|
|
|
| #elif defined(OS_POSIX)
|
| - bool ShouldUseZygote() override {
|
| +#if !defined(OS_MACOSX) && !defined(OS_ANDROID)
|
| + ZygoteHandle* GetZygote() override {
|
| const base::CommandLine& browser_command_line =
|
| *base::CommandLine::ForCurrentProcess();
|
| base::CommandLine::StringType renderer_prefix =
|
| browser_command_line.GetSwitchValueNative(switches::kRendererCmdPrefix);
|
| - return renderer_prefix.empty();
|
| + if (!renderer_prefix.empty())
|
| + return nullptr;
|
| +
|
| + static ZygoteHandle zygote;
|
| + if (zygote == nullptr) {
|
| + zygote = new ZygoteCommunication();
|
| + zygote->Init();
|
| + // 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(
|
| + zygote->GetSandboxStatus());
|
| + }
|
| + return &zygote;
|
| }
|
| +#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
|
| base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
|
| #endif // OS_WIN
|
|
|
|
|