| 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" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 // Returns true on success. | 86 // Returns true on success. |
| 87 bool JoinListValuesToString(const base::DictionaryValue* dictionary, | 87 bool JoinListValuesToString(const base::DictionaryValue* dictionary, |
| 88 const std::string key, | 88 const std::string key, |
| 89 std::string* result) { | 89 std::string* result) { |
| 90 const base::ListValue* list = nullptr; | 90 const base::ListValue* list = nullptr; |
| 91 if (!dictionary->GetListWithoutPathExpansion(key, &list)) | 91 if (!dictionary->GetListWithoutPathExpansion(key, &list)) |
| 92 return false; | 92 return false; |
| 93 | 93 |
| 94 std::string buffer; | 94 std::string buffer; |
| 95 bool first = true; | 95 bool first = true; |
| 96 for (const base::Value* v : *list) { | 96 for (const auto& v : *list) { |
| 97 std::string value; | 97 std::string value; |
| 98 if (!v->GetAsString(&value)) | 98 if (!v->GetAsString(&value)) |
| 99 return false; | 99 return false; |
| 100 | 100 |
| 101 if (first) | 101 if (first) |
| 102 first = false; | 102 first = false; |
| 103 else | 103 else |
| 104 buffer += ','; | 104 buffer += ','; |
| 105 | 105 |
| 106 buffer += value; | 106 buffer += value; |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 571 return StatisticsProviderImpl::GetInstance(); | 571 return StatisticsProviderImpl::GetInstance(); |
| 572 } | 572 } |
| 573 | 573 |
| 574 // static | 574 // static |
| 575 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { | 575 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { |
| 576 g_test_statistics_provider = test_provider; | 576 g_test_statistics_provider = test_provider; |
| 577 } | 577 } |
| 578 | 578 |
| 579 } // namespace system | 579 } // namespace system |
| 580 } // namespace chromeos | 580 } // namespace chromeos |
| OLD | NEW |