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

Unified Diff: webrtc/base/httpclient.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/httpclient.h ('k') | webrtc/base/httpcommon.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/httpclient.cc
diff --git a/webrtc/base/httpclient.cc b/webrtc/base/httpclient.cc
index e078334094a47409e90f2dc72ddb4ee679dde254..a458590bdb6406adc1509700cbd7092f897ae0b2 100644
--- a/webrtc/base/httpclient.cc
+++ b/webrtc/base/httpclient.cc
@@ -10,6 +10,7 @@
#include <time.h>
#include <algorithm>
+#include <memory>
#include "webrtc/base/asyncsocket.h"
#include "webrtc/base/common.h"
#include "webrtc/base/diskcache.h"
@@ -17,7 +18,6 @@
#include "webrtc/base/httpcommon-inl.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/pathutils.h"
-#include "webrtc/base/scoped_ptr.h"
#include "webrtc/base/socketstream.h"
#include "webrtc/base/stringencode.h"
#include "webrtc/base/stringutils.h"
@@ -466,7 +466,8 @@ bool HttpClient::BeginCacheFile() {
return false;
}
- scoped_ptr<StreamInterface> stream(cache_->WriteResource(id, kCacheBody));
+ std::unique_ptr<StreamInterface> stream(
+ cache_->WriteResource(id, kCacheBody));
if (!stream) {
LOG_F(LS_ERROR) << "Couldn't open body cache";
return false;
@@ -485,7 +486,8 @@ bool HttpClient::BeginCacheFile() {
}
HttpError HttpClient::WriteCacheHeaders(const std::string& id) {
- scoped_ptr<StreamInterface> stream(cache_->WriteResource(id, kCacheHeader));
+ std::unique_ptr<StreamInterface> stream(
+ cache_->WriteResource(id, kCacheHeader));
if (!stream) {
LOG_F(LS_ERROR) << "Couldn't open header cache";
return HE_CACHE;
@@ -563,7 +565,8 @@ bool HttpClient::CheckCache() {
}
HttpError HttpClient::ReadCacheHeaders(const std::string& id, bool override) {
- scoped_ptr<StreamInterface> stream(cache_->ReadResource(id, kCacheHeader));
+ std::unique_ptr<StreamInterface> stream(
+ cache_->ReadResource(id, kCacheHeader));
if (!stream) {
return HE_CACHE;
}
@@ -586,7 +589,7 @@ HttpError HttpClient::ReadCacheBody(const std::string& id) {
HttpError error = HE_NONE;
size_t data_size;
- scoped_ptr<StreamInterface> stream(cache_->ReadResource(id, kCacheBody));
+ std::unique_ptr<StreamInterface> stream(cache_->ReadResource(id, kCacheBody));
if (!stream || !stream->GetAvailable(&data_size)) {
LOG_F(LS_ERROR) << "Unavailable cache body";
error = HE_CACHE;
@@ -599,7 +602,7 @@ HttpError HttpClient::ReadCacheBody(const std::string& id) {
&& response().document) {
// Allocate on heap to not explode the stack.
const int array_size = 1024 * 64;
- scoped_ptr<char[]> buffer(new char[array_size]);
+ std::unique_ptr<char[]> buffer(new char[array_size]);
StreamResult result = Flow(stream.get(), buffer.get(), array_size,
response().document.get());
if (SR_SUCCESS != result) {
« no previous file with comments | « webrtc/base/httpclient.h ('k') | webrtc/base/httpcommon.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698