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

Side by Side Diff: components/policy/core/browser/policy_error_map.cc

Issue 1223153003: Move JoinString to the base namespace (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: windows Created 5 years, 5 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 "components/policy/core/browser/policy_error_map.h" 5 #include "components/policy/core/browser/policy_error_map.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 const std::string& message) { 179 const std::string& message) {
180 AddError(new SchemaValidatingPendingError(policy, error_path, message)); 180 AddError(new SchemaValidatingPendingError(policy, error_path, message));
181 } 181 }
182 182
183 base::string16 PolicyErrorMap::GetErrors(const std::string& policy) { 183 base::string16 PolicyErrorMap::GetErrors(const std::string& policy) {
184 CheckReadyAndConvert(); 184 CheckReadyAndConvert();
185 std::pair<const_iterator, const_iterator> range = map_.equal_range(policy); 185 std::pair<const_iterator, const_iterator> range = map_.equal_range(policy);
186 std::vector<base::string16> list; 186 std::vector<base::string16> list;
187 for (const_iterator it = range.first; it != range.second; ++it) 187 for (const_iterator it = range.first; it != range.second; ++it)
188 list.push_back(it->second); 188 list.push_back(it->second);
189 return JoinString(list, '\n'); 189 return base::JoinString(list, base::ASCIIToUTF16("\n"));
190 } 190 }
191 191
192 bool PolicyErrorMap::empty() { 192 bool PolicyErrorMap::empty() {
193 CheckReadyAndConvert(); 193 CheckReadyAndConvert();
194 return map_.empty(); 194 return map_.empty();
195 } 195 }
196 196
197 size_t PolicyErrorMap::size() { 197 size_t PolicyErrorMap::size() {
198 CheckReadyAndConvert(); 198 CheckReadyAndConvert();
199 return map_.size(); 199 return map_.size();
(...skipping 29 matching lines...) Expand all
229 229
230 void PolicyErrorMap::CheckReadyAndConvert() { 230 void PolicyErrorMap::CheckReadyAndConvert() {
231 DCHECK(IsReady()); 231 DCHECK(IsReady());
232 for (size_t i = 0; i < pending_.size(); ++i) { 232 for (size_t i = 0; i < pending_.size(); ++i) {
233 Convert(pending_[i]); 233 Convert(pending_[i]);
234 } 234 }
235 pending_.clear(); 235 pending_.clear();
236 } 236 }
237 237
238 } // namespace policy 238 } // namespace policy
OLDNEW
« no previous file with comments | « components/nacl/renderer/platform_info.cc ('k') | components/proximity_auth/cryptauth/cryptauth_gcm_manager_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698