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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 2895613002: Return Request as unique_ptr from JobController::Start(). (Closed)
Patch Set: Created 3 years, 7 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_network_transaction.cc ('k') | net/http/http_stream_factory.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_network_transaction_unittest.cc
diff --git a/net/http/http_network_transaction_unittest.cc b/net/http/http_network_transaction_unittest.cc
index 8796b293bf1cfc7405d6d4859899c0d4ffc74e19..56b9a1838f05177a70aaa6b60ccbfb1dbc98be33 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -15224,20 +15224,21 @@ class FakeStreamFactory : public HttpStreamFactory {
return last_stream_request_;
}
- HttpStreamRequest* RequestStream(const HttpRequestInfo& info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config,
- HttpStreamRequest::Delegate* delegate,
- bool enable_ip_based_pooling,
- bool enable_alternative_services,
- const NetLogWithSource& net_log) override {
- FakeStreamRequest* fake_request = new FakeStreamRequest(priority, delegate);
+ std::unique_ptr<HttpStreamRequest> RequestStream(
+ const HttpRequestInfo& info,
+ RequestPriority priority,
+ const SSLConfig& server_ssl_config,
+ const SSLConfig& proxy_ssl_config,
+ HttpStreamRequest::Delegate* delegate,
+ bool enable_ip_based_pooling,
+ bool enable_alternative_services,
+ const NetLogWithSource& net_log) override {
+ auto fake_request = base::MakeUnique<FakeStreamRequest>(priority, delegate);
last_stream_request_ = fake_request->AsWeakPtr();
- return fake_request;
+ return std::move(fake_request);
Bence 2017/05/19 15:55:10 std::move is necessary here because |fake_request|
}
- HttpStreamRequest* RequestBidirectionalStreamImpl(
+ std::unique_ptr<HttpStreamRequest> RequestBidirectionalStreamImpl(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
@@ -15250,7 +15251,7 @@ class FakeStreamFactory : public HttpStreamFactory {
return nullptr;
}
- HttpStreamRequest* RequestWebSocketHandshakeStream(
+ std::unique_ptr<HttpStreamRequest> RequestWebSocketHandshakeStream(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
@@ -15260,10 +15261,10 @@ class FakeStreamFactory : public HttpStreamFactory {
bool enable_ip_based_pooling,
bool enable_alternative_services,
const NetLogWithSource& net_log) override {
- FakeStreamRequest* fake_request =
- new FakeStreamRequest(priority, delegate, create_helper);
+ auto fake_request =
+ base::MakeUnique<FakeStreamRequest>(priority, delegate, create_helper);
last_stream_request_ = fake_request->AsWeakPtr();
- return fake_request;
+ return std::move(fake_request);
Bence 2017/05/19 15:55:10 Same as above.
}
void PreconnectStreams(int num_streams,
« no previous file with comments | « net/http/http_network_transaction.cc ('k') | net/http/http_stream_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698