OLD | NEW |
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 "chromeos/system/statistics_provider.h" | 5 #include "chromeos/system/statistics_provider.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/files/file_path.h" | 9 #include "base/files/file_path.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 bool HasOemPrefix(const std::string& name) { | 84 bool HasOemPrefix(const std::string& name) { |
85 return name.substr(0, 4) == "oem_"; | 85 return name.substr(0, 4) == "oem_"; |
86 } | 86 } |
87 | 87 |
88 // The StatisticsProvider implementation used in production. | 88 // The StatisticsProvider implementation used in production. |
89 class StatisticsProviderImpl : public StatisticsProvider { | 89 class StatisticsProviderImpl : public StatisticsProvider { |
90 public: | 90 public: |
91 // StatisticsProvider implementation: | 91 // StatisticsProvider implementation: |
92 virtual void StartLoadingMachineStatistics( | 92 virtual void StartLoadingMachineStatistics( |
93 const scoped_refptr<base::TaskRunner>& file_task_runner, | 93 const scoped_refptr<base::TaskRunner>& file_task_runner, |
94 bool load_oem_manifest) OVERRIDE; | 94 bool load_oem_manifest) override; |
95 virtual bool GetMachineStatistic(const std::string& name, | 95 virtual bool GetMachineStatistic(const std::string& name, |
96 std::string* result) OVERRIDE; | 96 std::string* result) override; |
97 virtual bool GetMachineFlag(const std::string& name, bool* result) OVERRIDE; | 97 virtual bool GetMachineFlag(const std::string& name, bool* result) override; |
98 virtual void Shutdown() OVERRIDE; | 98 virtual void Shutdown() override; |
99 | 99 |
100 static StatisticsProviderImpl* GetInstance(); | 100 static StatisticsProviderImpl* GetInstance(); |
101 | 101 |
102 protected: | 102 protected: |
103 typedef std::map<std::string, bool> MachineFlags; | 103 typedef std::map<std::string, bool> MachineFlags; |
104 friend struct DefaultSingletonTraits<StatisticsProviderImpl>; | 104 friend struct DefaultSingletonTraits<StatisticsProviderImpl>; |
105 | 105 |
106 StatisticsProviderImpl(); | 106 StatisticsProviderImpl(); |
107 virtual ~StatisticsProviderImpl(); | 107 virtual ~StatisticsProviderImpl(); |
108 | 108 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 return StatisticsProviderImpl::GetInstance(); | 323 return StatisticsProviderImpl::GetInstance(); |
324 } | 324 } |
325 | 325 |
326 // static | 326 // static |
327 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { | 327 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { |
328 g_test_statistics_provider = test_provider; | 328 g_test_statistics_provider = test_provider; |
329 } | 329 } |
330 | 330 |
331 } // namespace system | 331 } // namespace system |
332 } // namespace chromeos | 332 } // namespace chromeos |
OLD | NEW |