Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / content / browser / power_profiler / power_data_provider.h
blob897bc9b636ca3158a77d70d80a9b9ad02d8e9203
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.
5 #ifndef CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_
6 #define CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_
8 #include <vector>
10 #include "base/memory/scoped_ptr.h"
11 #include "content/browser/power_profiler/power_event.h"
13 namespace base {
14 class TimeDelta;
15 } // namespace base
17 namespace content {
19 typedef std::vector<PowerEvent> PowerEventVector;
21 // A class used to get power usage.
22 class PowerDataProvider {
23 public:
24 enum AccuracyLevel {
25 High,
26 Moderate,
27 Low
30 static scoped_ptr<PowerDataProvider> Create();
32 PowerDataProvider() {}
33 virtual ~PowerDataProvider() {}
35 // Returns a vector of power events, one per type, for the types it supports.
36 virtual PowerEventVector GetData() = 0;
38 // Returns sampling rate at which the provider can operate.
39 virtual base::TimeDelta GetSamplingRate() = 0;
41 // Returns accuracy level of the provider.
42 virtual AccuracyLevel GetAccuracyLevel() = 0;
45 } // namespace content
47 #endif // CONTENT_BROWSER_POWER_PROFILER_POWER_DATA_PROVIDER_H_