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

Side by Side Diff: chrome/browser/chromeos/options/cert_library.cc

Issue 1870793002: Convert //chrome/browser/chromeos from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: iwyu fixes Created 4 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
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 "chrome/browser/chromeos/options/cert_library.h" 5 #include "chrome/browser/chromeos/options/cert_library.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/i18n/string_compare.h" 10 #include "base/i18n/string_compare.h"
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 server_ca_certs_.push_back(iter->get()); 227 server_ca_certs_.push_back(iter->get());
228 break; 228 break;
229 } 229 }
230 default: 230 default:
231 break; 231 break;
232 } 232 }
233 } 233 }
234 234
235 // Perform locale-sensitive sorting by certificate name. 235 // Perform locale-sensitive sorting by certificate name.
236 UErrorCode error = U_ZERO_ERROR; 236 UErrorCode error = U_ZERO_ERROR;
237 scoped_ptr<icu::Collator> collator(icu::Collator::createInstance( 237 std::unique_ptr<icu::Collator> collator(icu::Collator::createInstance(
238 icu::Locale(g_browser_process->GetApplicationLocale().c_str()), error)); 238 icu::Locale(g_browser_process->GetApplicationLocale().c_str()), error));
239 if (U_FAILURE(error)) 239 if (U_FAILURE(error))
240 collator.reset(); 240 collator.reset();
241 CertNameComparator cert_name_comparator(collator.get()); 241 CertNameComparator cert_name_comparator(collator.get());
242 std::sort(certs_.begin(), certs_.end(), cert_name_comparator); 242 std::sort(certs_.begin(), certs_.end(), cert_name_comparator);
243 std::sort(user_certs_.begin(), user_certs_.end(), cert_name_comparator); 243 std::sort(user_certs_.begin(), user_certs_.end(), cert_name_comparator);
244 std::sort(server_certs_.begin(), server_certs_.end(), cert_name_comparator); 244 std::sort(server_certs_.begin(), server_certs_.end(), cert_name_comparator);
245 std::sort(server_ca_certs_.begin(), server_ca_certs_.end(), 245 std::sort(server_ca_certs_.begin(), server_ca_certs_.end(),
246 cert_name_comparator); 246 cert_name_comparator);
247 247
(...skipping 20 matching lines...) Expand all
268 return user_certs_; 268 return user_certs_;
269 if (type == CERT_TYPE_SERVER) 269 if (type == CERT_TYPE_SERVER)
270 return server_certs_; 270 return server_certs_;
271 if (type == CERT_TYPE_SERVER_CA) 271 if (type == CERT_TYPE_SERVER_CA)
272 return server_ca_certs_; 272 return server_ca_certs_;
273 DCHECK(type == CERT_TYPE_DEFAULT); 273 DCHECK(type == CERT_TYPE_DEFAULT);
274 return certs_; 274 return certs_;
275 } 275 }
276 276
277 } // namespace chromeos 277 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698