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

Unified Diff: net/http/http_basic_stream.cc

Issue 2255883002: Pass ClientSocketHandle ownership around in unique_ptr. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « net/http/http_basic_stream.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_basic_stream.cc
diff --git a/net/http/http_basic_stream.cc b/net/http/http_basic_stream.cc
index a82f9fccaf464981a25ce659987e62f673c886fb..d7a9ce065646e27f190950139191610bc1d62643 100644
--- a/net/http/http_basic_stream.cc
+++ b/net/http/http_basic_stream.cc
@@ -4,7 +4,7 @@
#include "net/http/http_basic_stream.h"
-#include <memory>
+#include <utility>
#include "net/http/http_request_info.h"
#include "net/http/http_response_body_drainer.h"
@@ -13,9 +13,9 @@
namespace net {
-HttpBasicStream::HttpBasicStream(ClientSocketHandle* connection,
+HttpBasicStream::HttpBasicStream(std::unique_ptr<ClientSocketHandle> connection,
bool using_proxy)
- : state_(connection, using_proxy) {}
+ : state_(std::move(connection), using_proxy) {}
HttpBasicStream::~HttpBasicStream() {}
@@ -60,8 +60,7 @@ HttpStream* HttpBasicStream::RenewStreamForAuth() {
// be extra-sure it doesn't touch the connection again, delete it here rather
// than leaving it until the destructor is called.
state_.DeleteParser();
- return new HttpBasicStream(state_.ReleaseConnection().release(),
- state_.using_proxy());
+ return new HttpBasicStream(state_.ReleaseConnection(), state_.using_proxy());
}
bool HttpBasicStream::IsResponseBodyComplete() const {
« no previous file with comments | « net/http/http_basic_stream.h ('k') | net/http/http_network_transaction_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698