Index: content/worker/worker_main.cc |
=================================================================== |
--- content/worker/worker_main.cc (revision 174805) |
+++ content/worker/worker_main.cc (working copy) |
@@ -29,8 +29,6 @@ |
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,11 +43,17 @@ |
::GetUserDefaultLCID(); |
target_services->LowerToken(); |
-#endif |
- |
-#if defined(OS_LINUX) |
+#elif defined(OS_MAC) |
+ // On OS X, if the sandbox fails to initialize, something has gone terribly |
+ // wrong and we should die. |
+ CHECK(InitializeSandbox()); |
+#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)) { |