diff options
author | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 23:46:53 +0000 |
---|---|---|
committer | jam@chromium.org <jam@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-03-18 23:46:53 +0000 |
commit | 4f4a13fdcca50a40cc0d761fe9bd00b643169992 (patch) | |
tree | 1e9e92deee4830a194c50232327754a99403ccf1 /chrome/worker | |
parent | c9d869c9d91ccb7ad8f061a93e7265bcddd85b47 (diff) | |
download | chromium_src-4f4a13fdcca50a40cc0d761fe9bd00b643169992.zip chromium_src-4f4a13fdcca50a40cc0d761fe9bd00b643169992.tar.gz chromium_src-4f4a13fdcca50a40cc0d761fe9bd00b643169992.tar.bz2 |
Refactor sandboxing code so that it can be used by worker processes.
Review URL: http://codereview.chromium.org/42311
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12038 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/worker')
-rw-r--r-- | chrome/worker/worker_main.cc | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/chrome/worker/worker_main.cc b/chrome/worker/worker_main.cc index b3c4256..1b973c3 100644 --- a/chrome/worker/worker_main.cc +++ b/chrome/worker/worker_main.cc @@ -12,7 +12,11 @@ #include "chrome/common/main_function_params.h" #include "chrome/common/win_util.h" #include "chrome/worker/worker_process.h" + +#if defined(OS_WIN) +#include "chrome/common/sandbox_init_wrapper.h" #include "sandbox/src/sandbox.h" +#endif // Mainline routine for running as the worker process. int WorkerMain(const MainFunctionParams& parameters) { @@ -26,10 +30,15 @@ int WorkerMain(const MainFunctionParams& parameters) { // Initialize the SystemMonitor base::SystemMonitor::Start(); - // TODO(jabdelmalek): refactor sandboxing code from renderer so that the - // workers are sandboxed. - WorkerProcess worker_process; +#if defined(OS_WIN) + sandbox::TargetServices* target_services = + parameters.sandbox_info_.TargetServices(); + if (!target_services) + return false; + + target_services->LowerToken(); +#endif // Load the accelerator table from the browser executable and tell the // message loop to use it when translating messages. |