| 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/lazy_instance.h" | 7 #include "base/lazy_instance.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
| 10 #include "base/power_monitor/power_monitor.h" | 10 #include "base/power_monitor/power_monitor.h" |
| 11 #include "base/power_monitor/power_monitor_device_source.h" |
| 11 #include "base/process/launch.h" | 12 #include "base/process/launch.h" |
| 12 #include "base/process/memory.h" | 13 #include "base/process/memory.h" |
| 13 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
| 14 #include "base/timer/hi_res_timer_manager.h" | 15 #include "base/timer/hi_res_timer_manager.h" |
| 15 #include "chrome/app/breakpad_win.h" | 16 #include "chrome/app/breakpad_win.h" |
| 16 #include "chrome/app/chrome_breakpad_client.h" | 17 #include "chrome/app/chrome_breakpad_client.h" |
| 17 #include "chrome/common/chrome_result_codes.h" | 18 #include "chrome/common/chrome_result_codes.h" |
| 18 #include "chrome/common/logging_chrome.h" | 19 #include "chrome/common/logging_chrome.h" |
| 19 #include "components/breakpad/breakpad_client.h" | 20 #include "components/breakpad/breakpad_client.h" |
| 20 #include "components/nacl/broker/nacl_broker_listener.h" | 21 #include "components/nacl/broker/nacl_broker_listener.h" |
| (...skipping 16 matching lines...) Expand all Loading... |
| 37 } // namespace | 38 } // namespace |
| 38 | 39 |
| 39 // main() routine for the NaCl broker process. | 40 // main() routine for the NaCl broker process. |
| 40 // This is necessary for supporting NaCl in Chrome on Win64. | 41 // This is necessary for supporting NaCl in Chrome on Win64. |
| 41 int NaClBrokerMain(const content::MainFunctionParams& parameters) { | 42 int NaClBrokerMain(const content::MainFunctionParams& parameters) { |
| 42 const CommandLine& parsed_command_line = parameters.command_line; | 43 const CommandLine& parsed_command_line = parameters.command_line; |
| 43 | 44 |
| 44 base::MessageLoopForIO main_message_loop; | 45 base::MessageLoopForIO main_message_loop; |
| 45 base::PlatformThread::SetName("CrNaClBrokerMain"); | 46 base::PlatformThread::SetName("CrNaClBrokerMain"); |
| 46 | 47 |
| 47 base::PowerMonitor power_monitor; | 48 scoped_ptr<base::PowerMonitorSource> power_monitor_source( |
| 49 new base::PowerMonitorDeviceSource()); |
| 50 base::PowerMonitor power_monitor(power_monitor_source.Pass()); |
| 48 base::HighResolutionTimerManager hi_res_timer_manager; | 51 base::HighResolutionTimerManager hi_res_timer_manager; |
| 49 | 52 |
| 50 NaClBrokerListener listener; | 53 NaClBrokerListener listener; |
| 51 listener.Listen(); | 54 listener.Listen(); |
| 52 | 55 |
| 53 return 0; | 56 return 0; |
| 54 } | 57 } |
| 55 | 58 |
| 56 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { | 59 int APIENTRY wWinMain(HINSTANCE instance, HINSTANCE, wchar_t*, int) { |
| 57 sandbox::SandboxInterfaceInfo sandbox_info = {0}; | 60 sandbox::SandboxInterfaceInfo sandbox_info = {0}; |
| (...skipping 28 matching lines...) Expand all Loading... |
| 86 | 89 |
| 87 if (process_type == switches::kNaClLoaderProcess) | 90 if (process_type == switches::kNaClLoaderProcess) |
| 88 return NaClMain(main_params); | 91 return NaClMain(main_params); |
| 89 | 92 |
| 90 if (process_type == switches::kNaClBrokerProcess) | 93 if (process_type == switches::kNaClBrokerProcess) |
| 91 return NaClBrokerMain(main_params); | 94 return NaClBrokerMain(main_params); |
| 92 | 95 |
| 93 CHECK(false) << "Unknown NaCl 64 process."; | 96 CHECK(false) << "Unknown NaCl 64 process."; |
| 94 return -1; | 97 return -1; |
| 95 } | 98 } |
| OLD | NEW |