summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 02:38:41 +0000
committerjln@chromium.org <jln@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 02:38:41 +0000
commit8965dfc2006d21fdb35a9f78903fefff0c2d4e27 (patch)
tree43d9b6038869df1ae5cb91c1a83f8a8a1b4612ca
parent19a0f75dae7084f509e7a3738b68c7ac0cd448bf (diff)
downloadchromium_src-8965dfc2006d21fdb35a9f78903fefff0c2d4e27.zip
chromium_src-8965dfc2006d21fdb35a9f78903fefff0c2d4e27.tar.gz
chromium_src-8965dfc2006d21fdb35a9f78903fefff0c2d4e27.tar.bz2
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
-rw-r--r--content/worker/worker_main.cc11
1 files changed, 6 insertions, 5 deletions
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");