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

Side by Side Diff: chrome/browser/power/process_power_collector.h

Issue 1355063004: Template methods on Timer classes instead of the classes themselves. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: timer: fixcaller Created 5 years, 3 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_POWER_PROCESS_POWER_COLLECTOR_H_ 5 #ifndef CHROME_BROWSER_POWER_PROCESS_POWER_COLLECTOR_H_
6 #define CHROME_BROWSER_POWER_PROCESS_POWER_COLLECTOR_H_ 6 #define CHROME_BROWSER_POWER_PROCESS_POWER_COLLECTOR_H_
7 7
8 #include <map> 8 #include <map>
9 9
10 #include "base/memory/linked_ptr.h" 10 #include "base/memory/linked_ptr.h"
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 // information from SynchronizeProcesses() given a total amount 128 // information from SynchronizeProcesses() given a total amount
129 // of CPU used in this cycle, |total_cpu_percent|. 129 // of CPU used in this cycle, |total_cpu_percent|.
130 void RecordCpuUsageByOrigin(double total_cpu_percent); 130 void RecordCpuUsageByOrigin(double total_cpu_percent);
131 131
132 // Adds the information from a given RenderProcessHost to the |metrics_map_| 132 // Adds the information from a given RenderProcessHost to the |metrics_map_|
133 // for a given origin. Called by SynchronizeProcesses(). 133 // for a given origin. Called by SynchronizeProcesses().
134 void UpdateProcessInMap(const content::RenderProcessHost* render_process, 134 void UpdateProcessInMap(const content::RenderProcessHost* render_process,
135 const GURL& origin); 135 const GURL& origin);
136 136
137 ProcessMetricsMap metrics_map_; 137 ProcessMetricsMap metrics_map_;
138 base::RepeatingTimer<ProcessPowerCollector> timer_; 138 base::RepeatingTimer timer_;
139 139
140 // Callback to use to get CPU usage if set. 140 // Callback to use to get CPU usage if set.
141 CpuUsageCallback cpu_usage_callback_; 141 CpuUsageCallback cpu_usage_callback_;
142 142
143 // The factor to scale the CPU usage by. 143 // The factor to scale the CPU usage by.
144 double scale_factor_; 144 double scale_factor_;
145 145
146 DISALLOW_COPY_AND_ASSIGN(ProcessPowerCollector); 146 DISALLOW_COPY_AND_ASSIGN(ProcessPowerCollector);
147 }; 147 };
148 148
149 #endif // CHROME_BROWSER_POWER_PROCESS_POWER_COLLECTOR_H_ 149 #endif // CHROME_BROWSER_POWER_PROCESS_POWER_COLLECTOR_H_
OLDNEW
« no previous file with comments | « chrome/browser/performance_monitor/performance_monitor.h ('k') | chrome/browser/prerender/prerender_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698