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

Unified Diff: webrtc/base/helpers.cc

Issue 1920043002: Replace scoped_ptr with unique_ptr in webrtc/base/ (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Rebased 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 | « webrtc/base/fileutils_unittest.cc ('k') | webrtc/base/httpbase.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/helpers.cc
diff --git a/webrtc/base/helpers.cc b/webrtc/base/helpers.cc
index 1ad5d0e12ba9ae55ba302e3965f790e08744e050..0a39ee923e1d61b3db9fa6399aee34049595fff6 100644
--- a/webrtc/base/helpers.cc
+++ b/webrtc/base/helpers.cc
@@ -11,6 +11,7 @@
#include "webrtc/base/helpers.h"
#include <limits>
+#include <memory>
#if defined(FEATURE_ENABLE_SSL)
#include "webrtc/base/sslconfig.h"
@@ -28,7 +29,6 @@
#include "webrtc/base/base64.h"
#include "webrtc/base/basictypes.h"
#include "webrtc/base/logging.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/timeutils.h"
// Protect against max macro inclusion.
@@ -181,8 +181,8 @@ static const char kUuidDigit17[4] = {'8', '9', 'a', 'b'};
// This round about way of creating a global RNG is to safe-guard against
// indeterminant static initialization order.
-scoped_ptr<RandomGenerator>& GetGlobalRng() {
- RTC_DEFINE_STATIC_LOCAL(scoped_ptr<RandomGenerator>, global_rng,
+std::unique_ptr<RandomGenerator>& GetGlobalRng() {
+ RTC_DEFINE_STATIC_LOCAL(std::unique_ptr<RandomGenerator>, global_rng,
(new SecureRandomGenerator()));
return global_rng;
}
@@ -223,7 +223,7 @@ bool CreateRandomString(size_t len,
const char* table, int table_size,
std::string* str) {
str->clear();
- scoped_ptr<uint8_t[]> bytes(new uint8_t[len]);
+ std::unique_ptr<uint8_t[]> bytes(new uint8_t[len]);
if (!Rng().Generate(bytes.get(), len)) {
LOG(LS_ERROR) << "Failed to generate random string!";
return false;
@@ -250,7 +250,7 @@ bool CreateRandomString(size_t len, const std::string& table,
// Where 'x' is a hex digit, and 'y' is 8, 9, a or b.
std::string CreateRandomUuid() {
std::string str;
- scoped_ptr<uint8_t[]> bytes(new uint8_t[31]);
+ std::unique_ptr<uint8_t[]> bytes(new uint8_t[31]);
if (!Rng().Generate(bytes.get(), 31)) {
LOG(LS_ERROR) << "Failed to generate random string!";
return str;
« no previous file with comments | « webrtc/base/fileutils_unittest.cc ('k') | webrtc/base/httpbase.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698