Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(353)

Side by Side Diff: chrome/nacl/nacl_exe_win_64.cc

Issue 17074009: Created multi-process-friendly PowerMonitor interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing windows unit test errors Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/event_router_forwarder_unittest.cc ('k') | components/nacl/loader/nacl_main.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698