summaryrefslogtreecommitdiffstats
path: root/chrome/browser/zygote_main_linux.cc
diff options
context:
space:
mode:
authorjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 01:25:09 +0000
committerjam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-17 01:25:09 +0000
commite46b5a095b408fcb14b694e5176a07cb855afd6b (patch)
tree0b4f9b54290b5385f522898e25fa77e961663954 /chrome/browser/zygote_main_linux.cc
parent89715c9a225cb6bffe121693ca970700aa63ecd0 (diff)
downloadchromium_src-e46b5a095b408fcb14b694e5176a07cb855afd6b.zip
chromium_src-e46b5a095b408fcb14b694e5176a07cb855afd6b.tar.gz
chromium_src-e46b5a095b408fcb14b694e5176a07cb855afd6b.tar.bz2
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
Diffstat (limited to 'chrome/browser/zygote_main_linux.cc')
-rw-r--r--chrome/browser/zygote_main_linux.cc14
1 files changed, 14 insertions, 0 deletions
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<NPAPI::PluginLib> pdf_lib =
+ NPAPI::PluginLib::CreatePluginLib(pdf);
+ bool rv = pdf_lib->EnsureAlwaysLoaded();
+ DCHECK(rv) << "Couldn't load PDF plugin";
+ }
}
#if !defined(CHROMIUM_SELINUX)