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

Side by Side Diff: content/public/browser/power_data_provider.h

Issue 140583003: Chrome power profiler service (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 6 years, 11 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_PUBLIC_BROWSER_POWER_DATA_PROVIDER_H_
6 #define CONTENT_PUBLIC_BROWSER_POWER_DATA_PROVIDER_H_
7
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/time/time.h"
11
12 namespace content {
13
14 struct PowerEvent {
15 enum Type {
qsr 2014/01/27 10:01:47 You should remove Type. Right now you have a singl
Pan 2014/01/28 09:58:04 Yes, it is a little weird to have only one type in
16 // Total power of SoC. including CPU, GT and others on the chip.
17 SOC_PACKAGE,
18
19 // Count the number of known PowerEvent.
20 ID_COUNT
21 };
22
23 Type type;
24 base::TimeTicks time; // Time that power data was read.
25
26 // Power value between last event to this one, in watt,
qsr 2014/01/27 10:01:47 What does Power value mean? Power consumption migh
Pan 2014/01/28 09:58:04 For SOC_PACKAGE power, it means power consumed in
27 // so value of the first event that observer received should be ignored.
28 double value;
29 };
30
31 // a class used to GET power usage.
32 class PowerDataProvider {
33 public:
34 PowerDataProvider() { }
qsr 2014/01/27 10:01:47 No spaces inside {}, here and everywhere on this C
Pan 2014/01/28 13:32:58 Done.
35 virtual ~PowerDataProvider() { }
36
37 // Return true when success, it fills a single PowerEvent, which should be
38 // allocated by its caller.
39 virtual bool GetData(PowerEvent*) = 0;
40
41 private:
42 DISALLOW_COPY_AND_ASSIGN(PowerDataProvider);
43 };
44
45 class PowerDataProviderFactory {
46 public:
47 // Create a provider, and transfer the ownership to PowerProfilerService.
48 static scoped_ptr<PowerDataProvider> Create();
49
50 private:
51 PowerDataProviderFactory() { }
52 DISALLOW_COPY_AND_ASSIGN(PowerDataProviderFactory);
53 };
54
55 } // namespace content
56
57 #endif // CONTENT_PUBLIC_BROWSER_POWER_DATA_PROVIDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698