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

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

Issue 1394993004: Make ValueDeserializer::Deserialize return scoped_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix and add todo about not failed trybot Created 5 years, 2 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
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 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 496
497 // Finished loading the statistics. 497 // Finished loading the statistics.
498 on_statistics_loaded_.Signal(); 498 on_statistics_loaded_.Signal();
499 VLOG(1) << "Finished loading statistics."; 499 VLOG(1) << "Finished loading statistics.";
500 } 500 }
501 501
502 void StatisticsProviderImpl::LoadRegionsFile(const base::FilePath& filename) { 502 void StatisticsProviderImpl::LoadRegionsFile(const base::FilePath& filename) {
503 JSONFileValueDeserializer regions_file(filename); 503 JSONFileValueDeserializer regions_file(filename);
504 int regions_error_code = 0; 504 int regions_error_code = 0;
505 std::string regions_error_message; 505 std::string regions_error_message;
506 regional_data_.reset( 506 regional_data_ =
507 regions_file.Deserialize(&regions_error_code, &regions_error_message)); 507 regions_file.Deserialize(&regions_error_code, &regions_error_message);
508 if (!regional_data_.get()) { 508 if (!regional_data_.get()) {
509 if (base::SysInfo::IsRunningOnChromeOS()) 509 if (base::SysInfo::IsRunningOnChromeOS())
510 LOG(ERROR) << "Failed to load regions file '" << filename.value() 510 LOG(ERROR) << "Failed to load regions file '" << filename.value()
511 << "': error='" << regions_error_message << "'"; 511 << "': error='" << regions_error_message << "'";
512 512
513 return; 513 return;
514 } 514 }
515 const base::DictionaryValue* full_dict = nullptr; 515 const base::DictionaryValue* full_dict = nullptr;
516 if (!regional_data_->GetAsDictionary(&full_dict)) { 516 if (!regional_data_->GetAsDictionary(&full_dict)) {
517 LOG(ERROR) << "Bad regions file '" << filename.value() 517 LOG(ERROR) << "Bad regions file '" << filename.value()
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
559 return StatisticsProviderImpl::GetInstance(); 559 return StatisticsProviderImpl::GetInstance();
560 } 560 }
561 561
562 // static 562 // static
563 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { 563 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) {
564 g_test_statistics_provider = test_provider; 564 g_test_statistics_provider = test_provider;
565 } 565 }
566 566
567 } // namespace system 567 } // namespace system
568 } // namespace chromeos 568 } // namespace chromeos
OLDNEW
« no previous file with comments | « chromeos/network/onc/onc_utils_unittest.cc ('k') | chromeos/tools/onc_validator/onc_validator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698