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

Unified Diff: webrtc/system_wrappers/include/utf_util_win.h

Issue 1937693002: Replace scoped_ptr with unique_ptr everywhere (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@unique5
Patch Set: 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
Index: webrtc/system_wrappers/include/utf_util_win.h
diff --git a/webrtc/system_wrappers/include/utf_util_win.h b/webrtc/system_wrappers/include/utf_util_win.h
index 0e3f2d01c60e977f6246a1d577ebe625da5098f3..730aa4649e17e225fadb622585ab74713db036b4 100644
--- a/webrtc/system_wrappers/include/utf_util_win.h
+++ b/webrtc/system_wrappers/include/utf_util_win.h
@@ -15,6 +15,8 @@
#ifdef WIN32
#include <windows.h>
+
+#include <memory>
#include <string>
#include "webrtc/base/scoped_ptr.h"
@@ -24,7 +26,7 @@ namespace webrtc {
inline std::wstring ToUtf16(const char* utf8, size_t len) {
int len16 = ::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len),
NULL, 0);
- rtc::scoped_ptr<wchar_t[]> ws(new wchar_t[len16]);
+ std::unique_ptr<wchar_t[]> ws(new wchar_t[len16]);
::MultiByteToWideChar(CP_UTF8, 0, utf8, static_cast<int>(len), ws.get(),
len16);
return std::wstring(ws.get(), len16);
@@ -37,7 +39,7 @@ inline std::wstring ToUtf16(const std::string& str) {
inline std::string ToUtf8(const wchar_t* wide, size_t len) {
int len8 = ::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len),
NULL, 0, NULL, NULL);
- rtc::scoped_ptr<char[]> ns(new char[len8]);
+ std::unique_ptr<char[]> ns(new char[len8]);
::WideCharToMultiByte(CP_UTF8, 0, wide, static_cast<int>(len), ns.get(), len8,
NULL, NULL);
return std::string(ns.get(), len8);
« no previous file with comments | « webrtc/system_wrappers/include/data_log_impl.h ('k') | webrtc/system_wrappers/source/aligned_malloc_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698