OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/at_exit.h" | 5 #include "base/at_exit.h" |
6 #include "base/command_line.h" | 6 #include "base/command_line.h" |
7 #include "base/hi_res_timer_manager.h" | |
8 #include "base/logging.h" | 7 #include "base/logging.h" |
9 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
10 #include "base/power_monitor/power_monitor.h" | 9 #include "base/power_monitor/power_monitor.h" |
11 #include "base/process_util.h" | 10 #include "base/process_util.h" |
12 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/timer/hi_res_timer_manager.h" |
13 #include "chrome/app/breakpad_win.h" | 13 #include "chrome/app/breakpad_win.h" |
14 #include "chrome/common/chrome_result_codes.h" | 14 #include "chrome/common/chrome_result_codes.h" |
15 #include "chrome/common/logging_chrome.h" | 15 #include "chrome/common/logging_chrome.h" |
16 #include "chrome/nacl/nacl_broker_listener.h" | 16 #include "chrome/nacl/nacl_broker_listener.h" |
17 #include "chrome/nacl/nacl_listener.h" | 17 #include "chrome/nacl/nacl_listener.h" |
18 #include "chrome/nacl/nacl_main_platform_delegate.h" | 18 #include "chrome/nacl/nacl_main_platform_delegate.h" |
19 #include "components/nacl/common/nacl_switches.h" | 19 #include "components/nacl/common/nacl_switches.h" |
20 #include "content/public/app/startup_helper_win.h" | 20 #include "content/public/app/startup_helper_win.h" |
21 #include "content/public/common/content_switches.h" | 21 #include "content/public/common/content_switches.h" |
22 #include "content/public/common/main_function_params.h" | 22 #include "content/public/common/main_function_params.h" |
23 #include "content/public/common/sandbox_init.h" | 23 #include "content/public/common/sandbox_init.h" |
24 #include "sandbox/win/src/sandbox_types.h" | 24 #include "sandbox/win/src/sandbox_types.h" |
25 | 25 |
26 extern int NaClMain(const content::MainFunctionParams&); | 26 extern int NaClMain(const content::MainFunctionParams&); |
27 | 27 |
28 // main() routine for the NaCl broker process. | 28 // main() routine for the NaCl broker process. |
29 // This is necessary for supporting NaCl in Chrome on Win64. | 29 // This is necessary for supporting NaCl in Chrome on Win64. |
30 int NaClBrokerMain(const content::MainFunctionParams& parameters) { | 30 int NaClBrokerMain(const content::MainFunctionParams& parameters) { |
31 const CommandLine& parsed_command_line = parameters.command_line; | 31 const CommandLine& parsed_command_line = parameters.command_line; |
32 | 32 |
33 base::MessageLoopForIO main_message_loop; | 33 base::MessageLoopForIO main_message_loop; |
34 base::PlatformThread::SetName("CrNaClBrokerMain"); | 34 base::PlatformThread::SetName("CrNaClBrokerMain"); |
35 | 35 |
36 base::PowerMonitor power_monitor; | 36 base::PowerMonitor power_monitor; |
37 HighResolutionTimerManager hi_res_timer_manager; | 37 base::HighResolutionTimerManager hi_res_timer_manager; |
38 | 38 |
39 NaClBrokerListener listener; | 39 NaClBrokerListener listener; |
40 listener.Listen(); | 40 listener.Listen(); |
41 | 41 |
42 return 0; | 42 return 0; |
43 } | 43 } |
44 | 44 |
45 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { | 45 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { |
46 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 46 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
47 content::InitializeSandboxInfo(&sandbox_info); | 47 content::InitializeSandboxInfo(&sandbox_info); |
(...skipping 26 matching lines...) Expand all Loading... |
74 | 74 |
75 if (process_type == switches::kNaClLoaderProcess) | 75 if (process_type == switches::kNaClLoaderProcess) |
76 return NaClMain(main_params); | 76 return NaClMain(main_params); |
77 | 77 |
78 if (process_type == switches::kNaClBrokerProcess) | 78 if (process_type == switches::kNaClBrokerProcess) |
79 return NaClBrokerMain(main_params); | 79 return NaClBrokerMain(main_params); |
80 | 80 |
81 CHECK(false) << "Unknown NaCl 64 process."; | 81 CHECK(false) << "Unknown NaCl 64 process."; |
82 return -1; | 82 return -1; |
83 } | 83 } |
OLD | NEW |