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

Unified Diff: components/autofill/core/common/autofill_l10n_util.cc

Issue 1541843002: Autofill's CountryCode should use scoped_ptr for owned pointers (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/autofill/core/common/autofill_l10n_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/autofill/core/common/autofill_l10n_util.cc
diff --git a/components/autofill/core/common/autofill_l10n_util.cc b/components/autofill/core/common/autofill_l10n_util.cc
index 8d2ff8013178d191d6e473bc64775c3837fc5688..6d6f2b5fc75655c20f40054b9451e68d71d87070 100644
--- a/components/autofill/core/common/autofill_l10n_util.cc
+++ b/components/autofill/core/common/autofill_l10n_util.cc
@@ -4,6 +4,8 @@
#include "components/autofill/core/common/autofill_l10n_util.h"
+#include <utility>
+
#include "base/i18n/string_compare.h"
#include "base/logging.h"
#include "base/metrics/histogram_macros.h"
@@ -11,9 +13,10 @@
namespace autofill {
namespace l10n {
-icu::Collator* GetCollatorForLocale(const icu::Locale& locale) {
+scoped_ptr<icu::Collator> GetCollatorForLocale(const icu::Locale& locale) {
UErrorCode ignored = U_ZERO_ERROR;
- icu::Collator* collator(icu::Collator::createInstance(locale, ignored));
+ scoped_ptr<icu::Collator> collator(
+ icu::Collator::createInstance(locale, ignored));
if (!collator) {
// On some systems, the default locale is invalid to the eyes of the ICU
// library. This could be due to a device-specific issue (has been seen in
@@ -26,8 +29,8 @@ icu::Collator* GetCollatorForLocale(const icu::Locale& locale) {
<< locale_name;
// Attempt to load the English locale.
- collator =
- icu::Collator::createInstance(icu::Locale::getEnglish(), ignored);
+ collator = make_scoped_ptr(
+ icu::Collator::createInstance(icu::Locale::getEnglish(), ignored));
if (!collator) {
LOG(ERROR) << "Failed to initialize the ICU Collator with the English "
<< "locale.";
« no previous file with comments | « components/autofill/core/common/autofill_l10n_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698