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

Unified Diff: net/http/http_network_transaction_unittest.cc

Issue 2893713004: Return Request as unique_ptr from JobController::Start(). (Closed)
Patch Set: Fix conflict with https://crrev.com/2887773006. 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 1079a24874de1c4a81bcbfc69f4d6c53a23f9c95..7321e39afb36e9383a05adab66929da4a46956c0 100644
--- a/net/http/http_network_transaction_unittest.cc
+++ b/net/http/http_network_transaction_unittest.cc
@@ -15227,20 +15227,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);
}
- HttpStreamRequest* RequestBidirectionalStreamImpl(
+ std::unique_ptr<HttpStreamRequest> RequestBidirectionalStreamImpl(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
@@ -15253,7 +15254,7 @@ class FakeStreamFactory : public HttpStreamFactory {
return nullptr;
}
- HttpStreamRequest* RequestWebSocketHandshakeStream(
+ std::unique_ptr<HttpStreamRequest> RequestWebSocketHandshakeStream(
const HttpRequestInfo& info,
RequestPriority priority,
const SSLConfig& server_ssl_config,
@@ -15263,10 +15264,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);
}
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