| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/nacl/loader/nacl_helper_win_64.h" | 5 #include "components/nacl/loader/nacl_helper_win_64.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 | 30 |
| 31 extern int NaClMain(const content::MainFunctionParams&); | 31 extern int NaClMain(const content::MainFunctionParams&); |
| 32 | 32 |
| 33 namespace { | 33 namespace { |
| 34 // main() routine for the NaCl broker process. | 34 // main() routine for the NaCl broker process. |
| 35 // This is necessary for supporting NaCl in Chrome on Win64. | 35 // This is necessary for supporting NaCl in Chrome on Win64. |
| 36 int NaClBrokerMain(const content::MainFunctionParams& parameters) { | 36 int NaClBrokerMain(const content::MainFunctionParams& parameters) { |
| 37 base::MessageLoopForIO main_message_loop; | 37 base::MessageLoopForIO main_message_loop; |
| 38 base::PlatformThread::SetName("CrNaClBrokerMain"); | 38 base::PlatformThread::SetName("CrNaClBrokerMain"); |
| 39 | 39 |
| 40 mojo::edk::Init(); | |
| 41 | |
| 42 std::unique_ptr<base::PowerMonitorSource> power_monitor_source( | 40 std::unique_ptr<base::PowerMonitorSource> power_monitor_source( |
| 43 new base::PowerMonitorDeviceSource()); | 41 new base::PowerMonitorDeviceSource()); |
| 44 base::PowerMonitor power_monitor(std::move(power_monitor_source)); | 42 base::PowerMonitor power_monitor(std::move(power_monitor_source)); |
| 45 base::HighResolutionTimerManager hi_res_timer_manager; | 43 base::HighResolutionTimerManager hi_res_timer_manager; |
| 46 | 44 |
| 47 NaClBrokerListener listener; | 45 NaClBrokerListener listener; |
| 48 listener.Listen(); | 46 listener.Listen(); |
| 49 | 47 |
| 50 return 0; | 48 return 0; |
| 51 } | 49 } |
| (...skipping 21 matching lines...) Expand all Loading... |
| 73 base::RouteStdioToConsole(true); | 71 base::RouteStdioToConsole(true); |
| 74 | 72 |
| 75 // Initialize the sandbox for this process. | 73 // Initialize the sandbox for this process. |
| 76 bool sandbox_initialized_ok = content::InitializeSandbox(&sandbox_info); | 74 bool sandbox_initialized_ok = content::InitializeSandbox(&sandbox_info); |
| 77 // Die if the sandbox can't be enabled. | 75 // Die if the sandbox can't be enabled. |
| 78 CHECK(sandbox_initialized_ok) << "Error initializing sandbox for " | 76 CHECK(sandbox_initialized_ok) << "Error initializing sandbox for " |
| 79 << process_type; | 77 << process_type; |
| 80 content::MainFunctionParams main_params(command_line); | 78 content::MainFunctionParams main_params(command_line); |
| 81 main_params.sandbox_info = &sandbox_info; | 79 main_params.sandbox_info = &sandbox_info; |
| 82 | 80 |
| 81 mojo::edk::Init(); |
| 82 |
| 83 if (process_type == switches::kNaClLoaderProcess) | 83 if (process_type == switches::kNaClLoaderProcess) |
| 84 return NaClMain(main_params); | 84 return NaClMain(main_params); |
| 85 | 85 |
| 86 if (process_type == switches::kNaClBrokerProcess) | 86 if (process_type == switches::kNaClBrokerProcess) |
| 87 return NaClBrokerMain(main_params); | 87 return NaClBrokerMain(main_params); |
| 88 | 88 |
| 89 CHECK(false) << "Unknown NaCl 64 process."; | 89 CHECK(false) << "Unknown NaCl 64 process."; |
| 90 return -1; | 90 return -1; |
| 91 } | 91 } |
| 92 | 92 |
| 93 } // namespace nacl | 93 } // namespace nacl |
| OLD | NEW |