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

Side by Side Diff: components/nacl/loader/nacl_helper_win_64.cc

Issue 2951413003: Add UMA for High Resolution Timer Usage (Closed)
Patch Set: Switched to using Timer in HighResolutionTimerManager Created 3 years, 5 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
OLDNEW
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"
11 #include "base/logging.h" 11 #include "base/logging.h"
12 #include "base/message_loop/message_loop.h" 12 #include "base/message_loop/message_loop.h"
13 #include "base/power_monitor/power_monitor.h" 13 #include "base/power_monitor/power_monitor.h"
14 #include "base/power_monitor/power_monitor_device_source.h" 14 #include "base/power_monitor/power_monitor_device_source.h"
15 #include "base/process/launch.h" 15 #include "base/process/launch.h"
16 #include "base/process/memory.h" 16 #include "base/process/memory.h"
17 #include "base/strings/string_util.h" 17 #include "base/strings/string_util.h"
18 #include "base/task_scheduler/task_scheduler.h"
18 #include "base/timer/hi_res_timer_manager.h" 19 #include "base/timer/hi_res_timer_manager.h"
19 #include "base/win/process_startup_helper.h" 20 #include "base/win/process_startup_helper.h"
20 #include "components/nacl/broker/nacl_broker_listener.h" 21 #include "components/nacl/broker/nacl_broker_listener.h"
21 #include "components/nacl/common/nacl_switches.h" 22 #include "components/nacl/common/nacl_switches.h"
22 #include "components/nacl/loader/nacl_listener.h" 23 #include "components/nacl/loader/nacl_listener.h"
23 #include "components/nacl/loader/nacl_main_platform_delegate.h" 24 #include "components/nacl/loader/nacl_main_platform_delegate.h"
24 #include "content/public/app/sandbox_helper_win.h" 25 #include "content/public/app/sandbox_helper_win.h"
25 #include "content/public/common/content_switches.h" 26 #include "content/public/common/content_switches.h"
26 #include "content/public/common/main_function_params.h" 27 #include "content/public/common/main_function_params.h"
27 #include "content/public/common/sandbox_init.h" 28 #include "content/public/common/sandbox_init.h"
28 #include "mojo/edk/embedder/embedder.h" 29 #include "mojo/edk/embedder/embedder.h"
29 #include "sandbox/win/src/sandbox_types.h" 30 #include "sandbox/win/src/sandbox_types.h"
30 31
31 extern int NaClMain(const content::MainFunctionParams&); 32 extern int NaClMain(const content::MainFunctionParams&);
32 33
33 namespace { 34 namespace {
34 // main() routine for the NaCl broker process. 35 // main() routine for the NaCl broker process.
35 // This is necessary for supporting NaCl in Chrome on Win64. 36 // This is necessary for supporting NaCl in Chrome on Win64.
36 int NaClBrokerMain(const content::MainFunctionParams& parameters) { 37 int NaClBrokerMain(const content::MainFunctionParams& parameters) {
37 base::MessageLoopForIO main_message_loop; 38 base::MessageLoopForIO main_message_loop;
38 base::PlatformThread::SetName("CrNaClBrokerMain"); 39 base::PlatformThread::SetName("CrNaClBrokerMain");
39 40
40 mojo::edk::Init(); 41 mojo::edk::Init();
41 42
43 base::TaskScheduler::CreateAndStartWithDefaultParams("NaCl");
44
42 std::unique_ptr<base::PowerMonitorSource> power_monitor_source( 45 std::unique_ptr<base::PowerMonitorSource> power_monitor_source(
43 new base::PowerMonitorDeviceSource()); 46 new base::PowerMonitorDeviceSource());
44 base::PowerMonitor power_monitor(std::move(power_monitor_source)); 47 base::PowerMonitor power_monitor(std::move(power_monitor_source));
45 base::HighResolutionTimerManager hi_res_timer_manager; 48 base::HighResolutionTimerManager hi_res_timer_manager;
46 49
47 NaClBrokerListener listener; 50 NaClBrokerListener listener;
48 listener.Listen(); 51 listener.Listen();
49 52
50 return 0; 53 return 0;
51 } 54 }
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
84 return NaClMain(main_params); 87 return NaClMain(main_params);
85 88
86 if (process_type == switches::kNaClBrokerProcess) 89 if (process_type == switches::kNaClBrokerProcess)
87 return NaClBrokerMain(main_params); 90 return NaClBrokerMain(main_params);
88 91
89 CHECK(false) << "Unknown NaCl 64 process."; 92 CHECK(false) << "Unknown NaCl 64 process.";
90 return -1; 93 return -1;
91 } 94 }
92 95
93 } // namespace nacl 96 } // namespace nacl
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698