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

Unified Diff: ui/base/l10n/formatter.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/base/l10n/formatter.h ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/l10n/formatter.cc
diff --git a/ui/base/l10n/formatter.cc b/ui/base/l10n/formatter.cc
index 94a83a49a03a9bcebe7cf5bf9489e8ad0df7245f..e15be773ceb6221387c8183e90c880590e8c700a 100644
--- a/ui/base/l10n/formatter.cc
+++ b/ui/base/l10n/formatter.cc
@@ -6,10 +6,10 @@
#include <limits.h>
+#include <memory>
#include <vector>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "third_party/icu/source/common/unicode/unistr.h"
#include "third_party/icu/source/i18n/unicode/msgfmt.h"
#include "ui/base/l10n/l10n_util.h"
@@ -143,9 +143,9 @@ static const Pluralities IDS_DURATION_HOUR_2ND = {
namespace {
-scoped_ptr<icu::PluralRules> BuildPluralRules() {
+std::unique_ptr<icu::PluralRules> BuildPluralRules() {
UErrorCode err = U_ZERO_ERROR;
- scoped_ptr<icu::PluralRules> rules(
+ std::unique_ptr<icu::PluralRules> rules(
icu::PluralRules::forLocale(icu::Locale::getDefault(), err));
if (U_FAILURE(err)) {
err = U_ZERO_ERROR;
@@ -231,7 +231,7 @@ void Formatter::Format(TwoUnits units,
return;
}
-scoped_ptr<icu::MessageFormat> Formatter::CreateFallbackFormat(
+std::unique_ptr<icu::MessageFormat> Formatter::CreateFallbackFormat(
const icu::PluralRules& rules,
const Pluralities& pluralities) const {
icu::UnicodeString pattern("{NUMBER, plural, ");
@@ -241,25 +241,25 @@ scoped_ptr<icu::MessageFormat> Formatter::CreateFallbackFormat(
pattern.append(UChar(0x7du)); // "}" = U+007D
UErrorCode error = U_ZERO_ERROR;
- scoped_ptr<icu::MessageFormat> format(
+ std::unique_ptr<icu::MessageFormat> format(
new icu::MessageFormat(pattern, error));
DCHECK(U_SUCCESS(error));
return format;
}
-scoped_ptr<icu::MessageFormat> Formatter::InitFormat(
+std::unique_ptr<icu::MessageFormat> Formatter::InitFormat(
const Pluralities& pluralities) {
if (!formatter_force_fallback) {
base::string16 pattern = l10n_util::GetStringUTF16(pluralities.id);
UErrorCode error = U_ZERO_ERROR;
- scoped_ptr<icu::MessageFormat> format(new icu::MessageFormat(
+ std::unique_ptr<icu::MessageFormat> format(new icu::MessageFormat(
icu::UnicodeString(FALSE, pattern.data(), pattern.length()), error));
DCHECK(U_SUCCESS(error));
if (format.get())
return format;
}
- scoped_ptr<icu::PluralRules> rules(BuildPluralRules());
+ std::unique_ptr<icu::PluralRules> rules(BuildPluralRules());
return CreateFallbackFormat(*rules, pluralities);
}
« no previous file with comments | « ui/base/l10n/formatter.h ('k') | ui/base/l10n/l10n_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698