From 8965dfc2006d21fdb35a9f78903fefff0c2d4e27 Mon Sep 17 00:00:00 2001 From: "jln@chromium.org" Date: Thu, 29 Nov 2012 02:38:41 +0000 Subject: Initialize the Linux sandbox earlier in workers. The Linux sandbox must be initialized before threads are created. BUG=156980 NOTRY=true Review URL: https://chromiumcodereview.appspot.com/11308161 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170125 0039d316-1c4b-4281-b951-d872f2087c98 --- content/worker/worker_main.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'content/worker') diff --git a/content/worker/worker_main.cc b/content/worker/worker_main.cc index cc401cb..efe3753 100644 --- a/content/worker/worker_main.cc +++ b/content/worker/worker_main.cc @@ -29,8 +29,6 @@ int WorkerMain(const MainFunctionParams& parameters) { base::SystemMonitor system_monitor; HighResolutionTimerManager hi_res_timer_manager; - ChildProcess worker_process; - worker_process.set_main_thread(new WorkerThread()); #if defined(OS_WIN) sandbox::TargetServices* target_services = parameters.sandbox_info->target_services; @@ -45,12 +43,15 @@ int WorkerMain(const MainFunctionParams& parameters) { ::GetUserDefaultLCID(); target_services->LowerToken(); -#endif - -#if defined(OS_LINUX) +#elif defined(OS_LINUX) + // On Linux, the sandbox must be initialized early, before any thread is + // created. InitializeSandbox(); #endif + ChildProcess worker_process; + worker_process.set_main_thread(new WorkerThread()); + const CommandLine& parsed_command_line = parameters.command_line; if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { ChildProcess::WaitForDebugger("Worker"); -- cgit v1.1