Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Unified Diff: content/worker/worker_main.cc

Issue 11737004: Merge 173432 (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1312/src/
Patch Set: Created 7 years, 12 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/common/sandbox_init_mac.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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)) {
« no previous file with comments | « content/common/sandbox_init_mac.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698