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

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

Issue 2740143002: Change base::Value::ListStorage to std::vector<base::Value> (Closed)
Patch Set: Rebase Created 3 years, 8 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 | « chromeos/printing/ppd_provider.cc ('k') | components/arc/net/arc_net_host_impl.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 <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
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
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
OLDNEW
« no previous file with comments | « chromeos/printing/ppd_provider.cc ('k') | components/arc/net/arc_net_host_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698