| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 "app/hi_res_timer_manager.h" | 5 #include "app/hi_res_timer_manager.h" |
| 6 #include "app/system_monitor.h" | 6 #include "app/system_monitor.h" |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.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 "chrome/common/child_process.h" | 10 #include "chrome/common/child_process.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 HighResolutionTimerManager hi_res_timer_manager; | 29 HighResolutionTimerManager hi_res_timer_manager; |
| 30 | 30 |
| 31 ChildProcess worker_process; | 31 ChildProcess worker_process; |
| 32 worker_process.set_main_thread(new WorkerThread()); | 32 worker_process.set_main_thread(new WorkerThread()); |
| 33 #if defined(OS_WIN) | 33 #if defined(OS_WIN) |
| 34 sandbox::TargetServices* target_services = | 34 sandbox::TargetServices* target_services = |
| 35 parameters.sandbox_info_.TargetServices(); | 35 parameters.sandbox_info_.TargetServices(); |
| 36 if (!target_services) | 36 if (!target_services) |
| 37 return false; | 37 return false; |
| 38 | 38 |
| 39 // Cause advapi32 to load before the sandbox is turned on. |
| 40 unsigned int dummy_rand; |
| 41 rand_s(&dummy_rand); |
| 42 |
| 39 target_services->LowerToken(); | 43 target_services->LowerToken(); |
| 40 #endif | 44 #endif |
| 41 | 45 |
| 42 const CommandLine& parsed_command_line = parameters.command_line_; | 46 const CommandLine& parsed_command_line = parameters.command_line_; |
| 43 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { | 47 if (parsed_command_line.HasSwitch(switches::kWaitForDebugger)) { |
| 44 ChildProcess::WaitForDebugger(L"Worker"); | 48 ChildProcess::WaitForDebugger(L"Worker"); |
| 45 } | 49 } |
| 46 | 50 |
| 47 // Load the accelerator table from the browser executable and tell the | 51 // Load the accelerator table from the browser executable and tell the |
| 48 // message loop to use it when translating messages. | 52 // message loop to use it when translating messages. |
| 49 MessageLoop::current()->Run(); | 53 MessageLoop::current()->Run(); |
| 50 | 54 |
| 51 return 0; | 55 return 0; |
| 52 } | 56 } |
| OLD | NEW |