diff options
Diffstat (limited to 'content/ppapi_plugin/ppapi_thread.cc')
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.cc | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index 4ad7cd2..9b3c846 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -6,10 +6,13 @@ #include <limits> +#include "base/command_line.h" #include "base/process_util.h" #include "base/rand_util.h" #include "base/stringprintf.h" #include "content/common/child_process.h" +#include "content/common/content_switches.h" +#include "content/common/sandbox_init_wrapper.h" #include "content/ppapi_plugin/broker_process_dispatcher.h" #include "content/ppapi_plugin/plugin_process_dispatcher.h" #include "content/ppapi_plugin/ppapi_webkit_thread.h" @@ -145,6 +148,17 @@ void PpapiThread::OnMsgLoadPlugin(const FilePath& path) { return; } +#if defined(OS_MACOSX) + // We need to do this after getting |PPP_GetInterface()| (or presumably + // doing something nontrivial with the library), else the sandbox + // intercedes. + CommandLine* parsed_command_line = CommandLine::ForCurrentProcess(); + SandboxInitWrapper sandbox_wrapper; + if (!sandbox_wrapper.InitializeSandbox(*parsed_command_line, + switches::kPpapiPluginProcess)) + LOG(WARNING) << "Failed to initialize sandbox"; +#endif + // Get the InitializeModule function (required). pp::proxy::Dispatcher::InitModuleFunc init_module = reinterpret_cast<pp::proxy::Dispatcher::InitModuleFunc>( |