Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: chromeos/system/statistics_provider.cc

Issue 1551753002: Build third-party code with -Wall, build chromium_code with -Wextra on Linux (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chromecast/crash/linux/dump_info.h ('k') | components/crash/content/app/breakpad_linux.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 211
212 // Extracts known data from regional_data_; 212 // Extracts known data from regional_data_;
213 // Returns true on success; 213 // Returns true on success;
214 bool GetRegionalInformation(const std::string& name, 214 bool GetRegionalInformation(const std::string& name,
215 std::string* result) const; 215 std::string* result) const;
216 216
217 // Returns current region dictionary or NULL if not found. 217 // Returns current region dictionary or NULL if not found.
218 const base::DictionaryValue* GetRegionDictionary() const; 218 const base::DictionaryValue* GetRegionDictionary() const;
219 219
220 // Returns extractor from regional_data_extractors_ or nullptr. 220 // Returns extractor from regional_data_extractors_ or nullptr.
221 const RegionDataExtractor GetRegionalDataExtractor( 221 RegionDataExtractor GetRegionalDataExtractor(const std::string& name) const;
222 const std::string& name) const;
223 222
224 bool load_statistics_started_; 223 bool load_statistics_started_;
225 NameValuePairsParser::NameValueMap machine_info_; 224 NameValuePairsParser::NameValueMap machine_info_;
226 MachineFlags machine_flags_; 225 MachineFlags machine_flags_;
227 base::CancellationFlag cancellation_flag_; 226 base::CancellationFlag cancellation_flag_;
228 // |on_statistics_loaded_| protects |machine_info_| and |machine_flags_|. 227 // |on_statistics_loaded_| protects |machine_info_| and |machine_flags_|.
229 base::WaitableEvent on_statistics_loaded_; 228 base::WaitableEvent on_statistics_loaded_;
230 bool oem_manifest_loaded_; 229 bool oem_manifest_loaded_;
231 std::string region_; 230 std::string region_;
232 scoped_ptr<base::Value> regional_data_; 231 scoped_ptr<base::Value> regional_data_;
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
265 if (!regional_data_->GetAsDictionary(&full_dict)) 264 if (!regional_data_->GetAsDictionary(&full_dict))
266 return nullptr; 265 return nullptr;
267 266
268 const base::DictionaryValue* region_dict = nullptr; 267 const base::DictionaryValue* region_dict = nullptr;
269 if (!full_dict->GetDictionaryWithoutPathExpansion(region_, &region_dict)) 268 if (!full_dict->GetDictionaryWithoutPathExpansion(region_, &region_dict))
270 return nullptr; 269 return nullptr;
271 270
272 return region_dict; 271 return region_dict;
273 } 272 }
274 273
275 const StatisticsProviderImpl::RegionDataExtractor 274 StatisticsProviderImpl::RegionDataExtractor
276 StatisticsProviderImpl::GetRegionalDataExtractor( 275 StatisticsProviderImpl::GetRegionalDataExtractor(
277 const std::string& name) const { 276 const std::string& name) const {
278 const auto it = regional_data_extractors_.find(name); 277 const auto it = regional_data_extractors_.find(name);
279 if (it == regional_data_extractors_.end()) 278 if (it == regional_data_extractors_.end())
280 return nullptr; 279 return nullptr;
281 280
282 return it->second; 281 return it->second;
283 } 282 }
284 283
285 bool StatisticsProviderImpl::GetRegionalInformation(const std::string& name, 284 bool StatisticsProviderImpl::GetRegionalInformation(const std::string& name,
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 return StatisticsProviderImpl::GetInstance(); 558 return StatisticsProviderImpl::GetInstance();
560 } 559 }
561 560
562 // static 561 // static
563 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { 562 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) {
564 g_test_statistics_provider = test_provider; 563 g_test_statistics_provider = test_provider;
565 } 564 }
566 565
567 } // namespace system 566 } // namespace system
568 } // namespace chromeos 567 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromecast/crash/linux/dump_info.h ('k') | components/crash/content/app/breakpad_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698