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 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 const std::string key, | 108 const std::string key, |
109 std::string* result) { | 109 std::string* result) { |
110 const base::ListValue* list = nullptr; | 110 const base::ListValue* list = nullptr; |
111 if (!dictionary->GetListWithoutPathExpansion(key, &list)) | 111 if (!dictionary->GetListWithoutPathExpansion(key, &list)) |
112 return false; | 112 return false; |
113 | 113 |
114 std::string buffer; | 114 std::string buffer; |
115 bool first = true; | 115 bool first = true; |
116 for (const auto& v : *list) { | 116 for (const auto& v : *list) { |
117 std::string value; | 117 std::string value; |
118 if (!v->GetAsString(&value)) | 118 if (!v.GetAsString(&value)) |
119 return false; | 119 return false; |
120 | 120 |
121 if (first) | 121 if (first) |
122 first = false; | 122 first = false; |
123 else | 123 else |
124 buffer += ','; | 124 buffer += ','; |
125 | 125 |
126 buffer += value; | 126 buffer += value; |
127 } | 127 } |
128 if (result != nullptr) | 128 if (result != nullptr) |
(...skipping 488 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
617 return StatisticsProviderImpl::GetInstance(); | 617 return StatisticsProviderImpl::GetInstance(); |
618 } | 618 } |
619 | 619 |
620 // static | 620 // static |
621 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { | 621 void StatisticsProvider::SetTestProvider(StatisticsProvider* test_provider) { |
622 g_test_statistics_provider = test_provider; | 622 g_test_statistics_provider = test_provider; |
623 } | 623 } |
624 | 624 |
625 } // namespace system | 625 } // namespace system |
626 } // namespace chromeos | 626 } // namespace chromeos |
OLD | NEW |