OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/app_switches.h" | 5 #include "app/app_switches.h" |
6 #include "app/hi_res_timer_manager.h" | 6 #include "app/hi_res_timer_manager.h" |
7 #include "app/system_monitor.h" | 7 #include "app/system_monitor.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
12 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 13 #include "base/threading/platform_thread.h" |
13 #include "chrome/common/child_process.h" | 14 #include "chrome/common/child_process.h" |
14 #include "chrome/common/chrome_constants.h" | 15 #include "chrome/common/chrome_constants.h" |
15 #include "chrome/common/chrome_paths.h" | 16 #include "chrome/common/chrome_paths.h" |
16 #include "chrome/common/chrome_switches.h" | 17 #include "chrome/common/chrome_switches.h" |
17 #include "chrome/common/extensions/extension_l10n_util.h" | 18 #include "chrome/common/extensions/extension_l10n_util.h" |
18 #include "chrome/common/logging_chrome.h" | 19 #include "chrome/common/logging_chrome.h" |
19 #include "chrome/common/main_function_params.h" | 20 #include "chrome/common/main_function_params.h" |
20 #include "chrome/utility/utility_thread.h" | 21 #include "chrome/utility/utility_thread.h" |
21 | 22 |
22 #if defined(OS_WIN) | 23 #if defined(OS_WIN) |
23 #include "chrome/common/sandbox_init_wrapper.h" | 24 #include "chrome/common/sandbox_init_wrapper.h" |
24 #include "sandbox/src/sandbox.h" | 25 #include "sandbox/src/sandbox.h" |
25 #endif // defined(OS_WIN) | 26 #endif // defined(OS_WIN) |
26 | 27 |
27 // Mainline routine for running as the utility process. | 28 // Mainline routine for running as the utility process. |
28 int UtilityMain(const MainFunctionParams& parameters) { | 29 int UtilityMain(const MainFunctionParams& parameters) { |
29 // The main message loop of the utility process. | 30 // The main message loop of the utility process. |
30 MessageLoop main_message_loop; | 31 MessageLoop main_message_loop; |
31 PlatformThread::SetName("CrUtilityMain"); | 32 base::PlatformThread::SetName("CrUtilityMain"); |
32 | 33 |
33 SystemMonitor system_monitor; | 34 SystemMonitor system_monitor; |
34 HighResolutionTimerManager hi_res_timer_manager; | 35 HighResolutionTimerManager hi_res_timer_manager; |
35 | 36 |
36 ChildProcess utility_process; | 37 ChildProcess utility_process; |
37 utility_process.set_main_thread(new UtilityThread()); | 38 utility_process.set_main_thread(new UtilityThread()); |
38 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
39 // Load the pdf plugin before the sandbox is turned on. This is for Windows | 40 // Load the pdf plugin before the sandbox is turned on. This is for Windows |
40 // only because we need this DLL only on Windows. | 41 // only because we need this DLL only on Windows. |
41 FilePath pdf; | 42 FilePath pdf; |
(...skipping 15 matching lines...) Expand all Loading... |
57 | 58 |
58 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 59 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
59 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); | 60 std::string lang = command_line->GetSwitchValueASCII(switches::kLang); |
60 if (!lang.empty()) | 61 if (!lang.empty()) |
61 extension_l10n_util::SetProcessLocale(lang); | 62 extension_l10n_util::SetProcessLocale(lang); |
62 | 63 |
63 MessageLoop::current()->Run(); | 64 MessageLoop::current()->Run(); |
64 | 65 |
65 return 0; | 66 return 0; |
66 } | 67 } |
OLD | NEW |