| 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 <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/containers/flat_map.h" |
| 11 #include "base/files/file_path.h" | 12 #include "base/files/file_path.h" |
| 12 #include "base/files/file_util.h" | 13 #include "base/files/file_util.h" |
| 13 #include "base/json/json_file_value_serializer.h" | 14 #include "base/json/json_file_value_serializer.h" |
| 14 #include "base/location.h" | 15 #include "base/location.h" |
| 15 #include "base/logging.h" | 16 #include "base/logging.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "base/memory/singleton.h" | 18 #include "base/memory/singleton.h" |
| 18 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 19 #include "base/strings/string_number_conversions.h" | 20 #include "base/strings/string_number_conversions.h" |
| 20 #include "base/strings/string_util.h" | 21 #include "base/strings/string_util.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 | 256 |
| 256 bool load_statistics_started_; | 257 bool load_statistics_started_; |
| 257 NameValuePairsParser::NameValueMap machine_info_; | 258 NameValuePairsParser::NameValueMap machine_info_; |
| 258 MachineFlags machine_flags_; | 259 MachineFlags machine_flags_; |
| 259 base::CancellationFlag cancellation_flag_; | 260 base::CancellationFlag cancellation_flag_; |
| 260 // |on_statistics_loaded_| protects |machine_info_| and |machine_flags_|. | 261 // |on_statistics_loaded_| protects |machine_info_| and |machine_flags_|. |
| 261 base::WaitableEvent on_statistics_loaded_; | 262 base::WaitableEvent on_statistics_loaded_; |
| 262 bool oem_manifest_loaded_; | 263 bool oem_manifest_loaded_; |
| 263 std::string region_; | 264 std::string region_; |
| 264 std::unique_ptr<base::Value> regional_data_; | 265 std::unique_ptr<base::Value> regional_data_; |
| 265 base::hash_map<std::string, RegionDataExtractor> regional_data_extractors_; | 266 base::flat_map<std::string, RegionDataExtractor> regional_data_extractors_; |
| 266 | 267 |
| 267 private: | 268 private: |
| 268 DISALLOW_COPY_AND_ASSIGN(StatisticsProviderImpl); | 269 DISALLOW_COPY_AND_ASSIGN(StatisticsProviderImpl); |
| 269 }; | 270 }; |
| 270 | 271 |
| 271 bool StatisticsProviderImpl::WaitForStatisticsLoaded() { | 272 bool StatisticsProviderImpl::WaitForStatisticsLoaded() { |
| 272 CHECK(load_statistics_started_); | 273 CHECK(load_statistics_started_); |
| 273 if (on_statistics_loaded_.IsSignaled()) | 274 if (on_statistics_loaded_.IsSignaled()) |
| 274 return true; | 275 return true; |
| 275 | 276 |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 625 return StatisticsProviderImpl::GetInstance(); | 626 return StatisticsProviderImpl::GetInstance(); |
| 626 } | 627 } |
| 627 | 628 |
| 628 // static | 629 // static |
| 629 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { | 630 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { |
| 630 g_test_statistics_provider = test_provider; | 631 g_test_statistics_provider = test_provider; |
| 631 } | 632 } |
| 632 | 633 |
| 633 } // namespace system | 634 } // namespace system |
| 634 } // namespace chromeos | 635 } // namespace chromeos |
| OLD | NEW |