OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/base_switches.h" | 5 #include "base/base_switches.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/hi_res_timer_manager.h" | 7 #include "base/hi_res_timer_manager.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/system_monitor/system_monitor.h" | 10 #include "base/system_monitor/system_monitor.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
36 return false; | 36 return false; |
37 | 37 |
38 // Cause advapi32 to load before the sandbox is turned on. | 38 // Cause advapi32 to load before the sandbox is turned on. |
39 unsigned int dummy_rand; | 39 unsigned int dummy_rand; |
40 rand_s(&dummy_rand); | 40 rand_s(&dummy_rand); |
41 // Warm up language subsystems before the sandbox is turned on. | 41 // Warm up language subsystems before the sandbox is turned on. |
42 ::GetUserDefaultLangID(); | 42 ::GetUserDefaultLangID(); |
43 ::GetUserDefaultLCID(); | 43 ::GetUserDefaultLCID(); |
44 | 44 |
45 target_services->LowerToken(); | 45 target_services->LowerToken(); |
46 #elif defined(OS_MAC) | 46 #elif defined(OS_MACOSX) |
jeremy
2013/03/19 10:06:40
Per separate email, this should be fixed on trunk.
| |
47 // On OS X, if the sandbox fails to initialize, something has gone terribly | 47 // On OS X, if the sandbox fails to initialize, something has gone terribly |
48 // wrong and we should die. | 48 // wrong and we should die. |
49 CHECK(InitializeSandbox()); | 49 CHECK(InitializeSandbox()); |
50 #elif defined(OS_LINUX) | 50 #elif defined(OS_LINUX) |
51 // On Linux, the sandbox must be initialized early, before any thread is | 51 // On Linux, the sandbox must be initialized early, before any thread is |
52 // created. | 52 // created. |
53 InitializeSandbox(); | 53 InitializeSandbox(); |
54 #endif | 54 #endif |
55 | 55 |
56 ChildProcess worker_process; | 56 ChildProcess worker_process; |
57 worker_process.set_main_thread(new WorkerThread()); | 57 worker_process.set_main_thread(new WorkerThread()); |
58 | 58 |
59 const CommandLine& parsed_command_line = parameters.command_line; | 59 const CommandLine& parsed_command_line = parameters.command_line; |
60 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { | 60 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { |
61 ChildProcess::WaitForDebugger("Worker"); | 61 ChildProcess::WaitForDebugger("Worker"); |
62 } | 62 } |
63 | 63 |
64 // Load the accelerator table from the browser executable and tell the | 64 // Load the accelerator table from the browser executable and tell the |
65 // message loop to use it when translating messages. | 65 // message loop to use it when translating messages. |
66 MessageLoop::current()->Run(); | 66 MessageLoop::current()->Run(); |
67 | 67 |
68 return 0; | 68 return 0; |
69 } | 69 } |
70 | 70 |
71 } // namespace content | 71 } // namespace content |
OLD | NEW |