unsandboxed_ppapi_processes_skip_zygote.patch 1.4 KB

1234567891011121314151617181920212223242526272829
  1. From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
  2. From: Jeremy Apthorp <[email protected]>
  3. Date: Tue, 16 Apr 2019 11:25:08 -0700
  4. Subject: unsandboxed_ppapi_processes_skip_zygote.patch
  5. Unsandboxed ppapi processes should skip zygote.
  6. diff --git a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
  7. index b141cfe3cc2e6e6563af03249bf5ec849e26d819..a1cc958e16162eee9686c73c207effe4880d50c7 100644
  8. --- a/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
  9. +++ b/content/browser/ppapi_plugin_sandboxed_process_launcher_delegate.cc
  10. @@ -10,6 +10,7 @@
  11. #include "build/build_config.h"
  12. #include "content/public/common/content_switches.h"
  13. #include "sandbox/policy/mojom/sandbox.mojom.h"
  14. +#include "sandbox/policy/switches.h"
  15. #if BUILDFLAG(IS_WIN)
  16. #include "sandbox/policy/win/sandbox_win.h"
  17. @@ -58,6 +59,9 @@ bool PpapiPluginSandboxedProcessLauncherDelegate::AllowWindowsFontsDir() {
  18. ZygoteCommunication* PpapiPluginSandboxedProcessLauncherDelegate::GetZygote() {
  19. const base::CommandLine& browser_command_line =
  20. *base::CommandLine::ForCurrentProcess();
  21. + if (browser_command_line.HasSwitch(sandbox::policy::switches::kNoSandbox)) {
  22. + return nullptr;
  23. + }
  24. base::CommandLine::StringType plugin_launcher =
  25. browser_command_line.GetSwitchValueNative(switches::kPpapiPluginLauncher);
  26. if (!plugin_launcher.empty())