diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-29 03:44:44 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-10-29 03:44:44 +0000 |
commit | badf5cf5f14c65f6c799ef1fec77cde8351339c2 (patch) | |
tree | 83690887c035e4b457f00404f126f95ad1a90c06 /content/ppapi_plugin | |
parent | 8cc9738eff9c169487e8356947d88640659fc497 (diff) | |
download | chromium_src-badf5cf5f14c65f6c799ef1fec77cde8351339c2.zip chromium_src-badf5cf5f14c65f6c799ef1fec77cde8351339c2.tar.gz chromium_src-badf5cf5f14c65f6c799ef1fec77cde8351339c2.tar.bz2 |
Expose the sandbox related code through the content API. I did a bit of cleanup while I was doing this.
-got rid of SandboxInitWrapper, since I didn't see a need to expose given that we can just expose sandbox::SandboxInterfaceInfo
-got rid of the duplicated code to initialize the broker
-since I made MainFunctionParams only have the sandbox struct on Windows, I also made the mac specific auto release pool behind an ifdef as well. It seemed odd to make something so mac specific compile on all platforms to save some #ifdefs.
BUG=98716
Review URL: http://codereview.chromium.org/8414020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107863 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r-- | content/ppapi_plugin/ppapi_broker_main.cc | 2 | ||||
-rw-r--r-- | content/ppapi_plugin/ppapi_plugin_main.cc | 4 | ||||
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.cc | 8 |
3 files changed, 6 insertions, 8 deletions
diff --git a/content/ppapi_plugin/ppapi_broker_main.cc b/content/ppapi_plugin/ppapi_broker_main.cc index 8789a61..f2a546e 100644 --- a/content/ppapi_plugin/ppapi_broker_main.cc +++ b/content/ppapi_plugin/ppapi_broker_main.cc @@ -12,7 +12,7 @@ // Main function for starting the PPAPI broker process. int PpapiBrokerMain(const MainFunctionParams& parameters) { - const CommandLine& command_line = parameters.command_line_; + const CommandLine& command_line = parameters.command_line; if (command_line.HasSwitch(switches::kPpapiStartupDialog)) { ChildProcess::WaitForDebugger("PpapiBroker"); } diff --git a/content/ppapi_plugin/ppapi_plugin_main.cc b/content/ppapi_plugin/ppapi_plugin_main.cc index f732c12..11d771d 100644 --- a/content/ppapi_plugin/ppapi_plugin_main.cc +++ b/content/ppapi_plugin/ppapi_plugin_main.cc @@ -29,10 +29,10 @@ void* g_target_services = 0; // Main function for starting the PPAPI plugin process. int PpapiPluginMain(const MainFunctionParams& parameters) { - const CommandLine& command_line = parameters.command_line_; + const CommandLine& command_line = parameters.command_line; #if defined(OS_WIN) - g_target_services = parameters.sandbox_info_.TargetServices(); + g_target_services = parameters.sandbox_info->target_services; #endif // If |g_target_services| is not null this process is sandboxed. One side diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index d0e9b6c..1bb38b1 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -11,11 +11,11 @@ #include "base/rand_util.h" #include "base/stringprintf.h" #include "content/common/child_process.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" #include "content/public/common/content_switches.h" +#include "content/public/common/sandbox_init.h" #include "ipc/ipc_channel_handle.h" #include "ipc/ipc_sync_channel.h" #include "ppapi/c/dev/ppp_network_state_dev.h" @@ -201,11 +201,9 @@ void PpapiThread::OnMsgLoadPlugin(const FilePath& path) { // 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)) + if (!content::InitializeSandbox()) { LOG(WARNING) << "Failed to initialize sandbox"; + } #endif // Get the InitializeModule function (required). |