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

Unified Diff: base/i18n/icu_string_conversions.cc

Issue 1852433005: Convert //base to use std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase after r384946 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 | « base/i18n/file_util_icu.cc ('k') | base/i18n/icu_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/i18n/icu_string_conversions.cc
diff --git a/base/i18n/icu_string_conversions.cc b/base/i18n/icu_string_conversions.cc
index 68ce5294f98c8a80744357c631e11b745e03646f..be82db2a956799d7b413f78cdc5b8309755ba04a 100644
--- a/base/i18n/icu_string_conversions.cc
+++ b/base/i18n/icu_string_conversions.cc
@@ -7,10 +7,10 @@
#include <stddef.h>
#include <stdint.h>
+#include <memory>
#include <vector>
#include "base/logging.h"
-#include "base/memory/scoped_ptr.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "third_party/icu/source/common/unicode/ucnv.h"
@@ -177,7 +177,7 @@ bool CodepageToUTF16(const std::string& encoded,
size_t uchar_max_length = encoded.length() + 1;
SetUpErrorHandlerForToUChars(on_error, converter, &status);
- scoped_ptr<char16[]> buffer(new char16[uchar_max_length]);
+ std::unique_ptr<char16[]> buffer(new char16[uchar_max_length]);
int actual_size = ucnv_toUChars(converter, buffer.get(),
static_cast<int>(uchar_max_length), encoded.data(),
static_cast<int>(encoded.length()), &status);
@@ -203,7 +203,7 @@ bool ConvertToUtf8AndNormalize(const std::string& text,
UErrorCode status = U_ZERO_ERROR;
size_t max_length = utf16.length() + 1;
string16 normalized_utf16;
- scoped_ptr<char16[]> buffer(new char16[max_length]);
+ std::unique_ptr<char16[]> buffer(new char16[max_length]);
int actual_length = unorm_normalize(
utf16.c_str(), utf16.length(), UNORM_NFC, 0,
buffer.get(), static_cast<int>(max_length), &status);
« no previous file with comments | « base/i18n/file_util_icu.cc ('k') | base/i18n/icu_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698