| OLD | NEW |
| 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 #include "chromeos/system/fake_statistics_provider.h" | 5 #include "chromeos/system/fake_statistics_provider.h" |
| 6 | 6 |
| 7 namespace chromeos { | 7 namespace chromeos { |
| 8 namespace system { | 8 namespace system { |
| 9 | 9 |
| 10 FakeStatisticsProvider::FakeStatisticsProvider() { | 10 FakeStatisticsProvider::FakeStatisticsProvider() { |
| 11 } | 11 } |
| 12 | 12 |
| 13 FakeStatisticsProvider::~FakeStatisticsProvider() { | 13 FakeStatisticsProvider::~FakeStatisticsProvider() { |
| 14 } | 14 } |
| 15 | 15 |
| 16 void FakeStatisticsProvider::StartLoadingMachineStatistics( | 16 void FakeStatisticsProvider::StartLoadingMachineStatistics( |
| 17 const scoped_refptr<base::TaskRunner>& file_task_runner, | |
| 18 bool load_oem_manifest) { | 17 bool load_oem_manifest) { |
| 19 } | 18 } |
| 20 | 19 |
| 21 bool FakeStatisticsProvider::GetMachineStatistic(const std::string& name, | 20 bool FakeStatisticsProvider::GetMachineStatistic(const std::string& name, |
| 22 std::string* result) { | 21 std::string* result) { |
| 23 std::map<std::string, std::string>::const_iterator match = | 22 std::map<std::string, std::string>::const_iterator match = |
| 24 machine_statistics_.find(name); | 23 machine_statistics_.find(name); |
| 25 if (match != machine_statistics_.end() && result) | 24 if (match != machine_statistics_.end() && result) |
| 26 *result = match->second; | 25 *result = match->second; |
| 27 return match != machine_statistics_.end(); | 26 return match != machine_statistics_.end(); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 ScopedFakeStatisticsProvider::ScopedFakeStatisticsProvider() { | 64 ScopedFakeStatisticsProvider::ScopedFakeStatisticsProvider() { |
| 66 StatisticsProvider::SetTestProvider(this); | 65 StatisticsProvider::SetTestProvider(this); |
| 67 } | 66 } |
| 68 | 67 |
| 69 ScopedFakeStatisticsProvider::~ScopedFakeStatisticsProvider() { | 68 ScopedFakeStatisticsProvider::~ScopedFakeStatisticsProvider() { |
| 70 StatisticsProvider::SetTestProvider(NULL); | 69 StatisticsProvider::SetTestProvider(NULL); |
| 71 } | 70 } |
| 72 | 71 |
| 73 } // namespace system | 72 } // namespace system |
| 74 } // namespace chromeos | 73 } // namespace chromeos |
| OLD | NEW |