From e46b5a095b408fcb14b694e5176a07cb855afd6b Mon Sep 17 00:00:00 2001 From: "jam@chromium.org" Date: Thu, 17 Jun 2010 01:25:09 +0000 Subject: Internal plugin needs to be loaded in a different place for the Linux sandbox. Review URL: http://codereview.chromium.org/2817012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@50066 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/zygote_main_linux.cc | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'chrome/browser/zygote_main_linux.cc') diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc index fc2d441..6b6a8f9 100644 --- a/chrome/browser/zygote_main_linux.cc +++ b/chrome/browser/zygote_main_linux.cc @@ -21,6 +21,7 @@ #include "base/basictypes.h" #include "base/command_line.h" #include "base/eintr_wrapper.h" +#include "base/file_util.h" #include "base/global_descriptors_posix.h" #include "base/hash_tables.h" #include "base/linux_util.h" @@ -34,6 +35,7 @@ #include "chrome/browser/zygote_host_linux.h" #include "chrome/common/chrome_descriptors.h" +#include "chrome/common/chrome_paths.h" #include "chrome/common/chrome_switches.h" #include "chrome/common/main_function_params.h" #include "chrome/common/process_watcher.h" @@ -47,6 +49,8 @@ #include "unicode/timezone.h" +#include "webkit/glue/plugins/plugin_lib.h" + #if defined(ARCH_CPU_X86_FAMILY) && !defined(CHROMIUM_SELINUX) // The seccomp sandbox is enabled on all ia32 and x86-64 processor as long as // we aren't using SELinux. @@ -528,6 +532,16 @@ static void PreSandboxInit() { FilePath module_path; if (PathService::Get(base::DIR_MODULE, &module_path)) media::InitializeMediaLibrary(module_path); + + // Load the PDF plugin before the sandbox is turned on. + FilePath pdf; + if (PathService::Get(chrome::FILE_PDF_PLUGIN, &pdf) && + file_util::PathExists(pdf)) { + static scoped_refptr pdf_lib = + NPAPI::PluginLib::CreatePluginLib(pdf); + bool rv = pdf_lib->EnsureAlwaysLoaded(); + DCHECK(rv) << "Couldn't load PDF plugin"; + } } #if !defined(CHROMIUM_SELINUX) -- cgit v1.1