summaryrefslogtreecommitdiff
path: root/chromium/content/browser/ppapi_plugin_process_host.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/content/browser/ppapi_plugin_process_host.cc')
-rw-r--r--chromium/content/browser/ppapi_plugin_process_host.cc25
1 files changed, 23 insertions, 2 deletions
diff --git a/chromium/content/browser/ppapi_plugin_process_host.cc b/chromium/content/browser/ppapi_plugin_process_host.cc
index 3523fc10a8b..56ae0eea7f4 100644
--- a/chromium/content/browser/ppapi_plugin_process_host.cc
+++ b/chromium/content/browser/ppapi_plugin_process_host.cc
@@ -35,6 +35,10 @@
#include "ppapi/proxy/ppapi_messages.h"
#include "ui/base/ui_base_switches.h"
+#if defined(OS_POSIX)
+#include "content/public/browser/zygote_handle_linux.h"
+#endif // defined(OS_POSIX)
+
#if defined(OS_WIN)
#include "content/browser/renderer_host/dwrite_font_proxy_message_filter_win.h"
#include "content/common/sandbox_win.h"
@@ -45,6 +49,10 @@
namespace content {
+#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
+ZygoteHandle g_ppapi_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 PpapiPluginSandboxedProcessLauncherDelegate
: public content::SandboxedProcessLauncherDelegate {
@@ -105,13 +113,18 @@ class PpapiPluginSandboxedProcessLauncherDelegate
}
#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 plugin_launcher = browser_command_line
.GetSwitchValueNative(switches::kPpapiPluginLauncher);
- return !is_broker_ && plugin_launcher.empty();
+ if (is_broker_ || !plugin_launcher.empty())
+ return nullptr;
+ return GetGenericZygote();
}
+#endif // !defined(OS_MACOSX) && !defined(OS_ANDROID)
+
base::ScopedFD TakeIpcFd() override { return std::move(ipc_fd_); }
#endif // OS_WIN
@@ -200,6 +213,14 @@ PpapiPluginProcessHost* PpapiPluginProcessHost::CreateBrokerHost(
return NULL;
}
+#if defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
+// static
+void PpapiPluginProcessHost::EarlyZygoteLaunch() {
+ DCHECK(!g_ppapi_zygote);
+ g_ppapi_zygote = CreateZygote();
+}
+#endif // defined(OS_POSIX) && !defined(OS_ANDROID) && !defined(OS_MACOSX)
+
// static
void PpapiPluginProcessHost::DidCreateOutOfProcessInstance(
int plugin_process_id,