OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 6 #define CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 namespace chromeos { | 10 namespace chromeos { |
11 namespace system { | 11 namespace system { |
12 | 12 |
13 // This interface provides access to Chrome OS statistics. | 13 // This interface provides access to Chrome OS statistics. |
14 class StatisticsProvider { | 14 class StatisticsProvider { |
15 public: | 15 public: |
| 16 // Initializes the statistics provider. |
| 17 virtual void Init() = 0; |
| 18 |
16 // Retrieve the named machine statistic (e.g. "hardware_class"). | 19 // Retrieve the named machine statistic (e.g. "hardware_class"). |
17 // This does not update the statistcs. If the |name| is not set, |result| | 20 // This does not update the statistcs. If the |name| is not set, |result| |
18 // preserves old value. | 21 // preserves old value. |
19 virtual bool GetMachineStatistic(const std::string& name, | 22 virtual bool GetMachineStatistic(const std::string& name, |
20 std::string* result) = 0; | 23 std::string* result) = 0; |
21 | 24 |
22 static StatisticsProvider* GetInstance(); | 25 static StatisticsProvider* GetInstance(); |
23 | 26 |
24 protected: | 27 protected: |
25 virtual ~StatisticsProvider() {} | 28 virtual ~StatisticsProvider() {} |
26 }; | 29 }; |
27 | 30 |
28 } // namespace system | 31 } // namespace system |
29 } // namespace chromeos | 32 } // namespace chromeos |
30 | 33 |
31 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ | 34 #endif // CHROME_BROWSER_CHROMEOS_SYSTEM_STATISTICS_PROVIDER_H_ |
OLD | NEW |