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

Unified Diff: base/i18n/icu_string_conversions.cc

Issue 11961021: base: Convert scoped_arrays to the new scoped_ptr style. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: revert callback changes Created 7 years, 11 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
Index: base/i18n/icu_string_conversions.cc
diff --git a/base/i18n/icu_string_conversions.cc b/base/i18n/icu_string_conversions.cc
index 5e428c37adf5815999a525ccd05b5c5622f549c9..2ff5009b120ab36534c7a94e6b9f31ec20e90fea 100644
--- a/base/i18n/icu_string_conversions.cc
+++ b/base/i18n/icu_string_conversions.cc
@@ -188,7 +188,7 @@ bool CodepageToUTF16(const std::string& encoded,
size_t uchar_max_length = encoded.length() + 1;
SetUpErrorHandlerForToUChars(on_error, converter, &status);
- scoped_array<char16> buffer(new char16[uchar_max_length]);
+ scoped_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);
@@ -253,7 +253,7 @@ bool CodepageToWide(const std::string& encoded,
size_t wchar_max_length = encoded.length() + 1;
SetUpErrorHandlerForToUChars(on_error, converter, &status);
- scoped_array<wchar_t> buffer(new wchar_t[wchar_max_length]);
+ scoped_ptr<wchar_t[]> buffer(new wchar_t[wchar_max_length]);
int actual_size = ucnv_toAlgorithmic(utf32_platform_endian(), converter,
reinterpret_cast<char*>(buffer.get()),
static_cast<int>(wchar_max_length) * sizeof(wchar_t), encoded.data(),
@@ -282,7 +282,7 @@ bool ConvertToUtf8AndNormalize(const std::string& text,
UErrorCode status = U_ZERO_ERROR;
size_t max_length = utf16.length() + 1;
string16 normalized_utf16;
- scoped_array<char16> buffer(new char16[max_length]);
+ scoped_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/file_util_proxy.cc ('k') | base/linux_util.cc » ('j') | base/nix/mime_util_xdg.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698