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

Unified Diff: webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm

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/sdk/objc/Framework/Classes/RTCFileLogger.mm
diff --git a/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm b/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm
index 73335f39da5077a3f600377432df308d983d81bf..c1fbd747c3c32a9c0c346879ca3c7f4381b6ac55 100644
--- a/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm
+++ b/webrtc/sdk/objc/Framework/Classes/RTCFileLogger.mm
@@ -10,11 +10,12 @@
#import "WebRTC/RTCFileLogger.h"
+#include <memory>
+
#include "webrtc/base/checks.h"
#include "webrtc/base/filerotatingstream.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/logsinks.h"
-#include "webrtc/base/scoped_ptr.h"
NSString *const kDefaultLogDirName = @"webrtc_logs";
NSUInteger const kDefaultMaxFileSize = 10 * 1024 * 1024; // 10MB.
@@ -24,7 +25,7 @@ const char *kRTCFileLoggerRotatingLogPrefix = "rotating_log";
BOOL _hasStarted;
NSString *_dirPath;
NSUInteger _maxFileSize;
- rtc::scoped_ptr<rtc::FileRotatingLogSink> _logSink;
+ std::unique_ptr<rtc::FileRotatingLogSink> _logSink;
}
@synthesize severity = _severity;
@@ -129,7 +130,7 @@ const char *kRTCFileLoggerRotatingLogPrefix = "rotating_log";
return nil;
}
NSMutableData* logData = [NSMutableData data];
- rtc::scoped_ptr<rtc::FileRotatingStream> stream;
+ std::unique_ptr<rtc::FileRotatingStream> stream;
switch(_rotationType) {
case RTCFileLoggerTypeApp:
stream.reset(
@@ -150,7 +151,7 @@ const char *kRTCFileLoggerRotatingLogPrefix = "rotating_log";
size_t read = 0;
// Allocate memory using malloc so we can pass it direcly to NSData without
// copying.
- rtc::scoped_ptr<uint8_t[]> buffer(static_cast<uint8_t*>(malloc(bufferSize)));
+ std::unique_ptr<uint8_t[]> buffer(static_cast<uint8_t*>(malloc(bufferSize)));
stream->ReadAll(buffer.get(), bufferSize, &read, nullptr);
logData = [[NSMutableData alloc] initWithBytesNoCopy:buffer.release()
length:read];
« no previous file with comments | « webrtc/sdk/objc/Framework/Classes/RTCDataChannel.mm ('k') | webrtc/sdk/objc/Framework/Classes/RTCIceCandidate.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698