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

Unified Diff: net/http/http_stream_factory_impl_job.cc

Issue 2895443002: Return Job as unique_ptr from factory methods. (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_stream_factory_impl_job.h ('k') | net/http/http_stream_factory_impl_job_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl_job.cc
diff --git a/net/http/http_stream_factory_impl_job.cc b/net/http/http_stream_factory_impl_job.cc
index a5a443885d080691b65c57a631bc8c0b0c0c6eb7..5c8bb7b988562d6edb873406ff00b61d294e485b 100644
--- a/net/http/http_stream_factory_impl_job.cc
+++ b/net/http/http_stream_factory_impl_job.cc
@@ -12,6 +12,7 @@
#include "base/feature_list.h"
#include "base/location.h"
#include "base/logging.h"
+#include "base/memory/ptr_util.h"
#include "base/metrics/histogram_macros.h"
#include "base/metrics/sparse_histogram.h"
#include "base/profiler/scoped_tracker.h"
@@ -1448,7 +1449,8 @@ HttpStreamFactoryImpl::JobFactory::JobFactory() {}
HttpStreamFactoryImpl::JobFactory::~JobFactory() {}
-HttpStreamFactoryImpl::Job* HttpStreamFactoryImpl::JobFactory::CreateMainJob(
+std::unique_ptr<HttpStreamFactoryImpl::Job>
+HttpStreamFactoryImpl::JobFactory::CreateMainJob(
HttpStreamFactoryImpl::Job::Delegate* delegate,
HttpStreamFactoryImpl::JobType job_type,
HttpNetworkSession* session,
@@ -1461,13 +1463,14 @@ HttpStreamFactoryImpl::Job* HttpStreamFactoryImpl::JobFactory::CreateMainJob(
GURL origin_url,
bool enable_ip_based_pooling,
NetLog* net_log) {
- return new HttpStreamFactoryImpl::Job(
+ return base::MakeUnique<HttpStreamFactoryImpl::Job>(
delegate, job_type, session, request_info, priority, proxy_info,
server_ssl_config, proxy_ssl_config, destination, origin_url,
enable_ip_based_pooling, net_log);
}
-HttpStreamFactoryImpl::Job* HttpStreamFactoryImpl::JobFactory::CreateAltSvcJob(
+std::unique_ptr<HttpStreamFactoryImpl::Job>
+HttpStreamFactoryImpl::JobFactory::CreateAltSvcJob(
HttpStreamFactoryImpl::Job::Delegate* delegate,
HttpStreamFactoryImpl::JobType job_type,
HttpNetworkSession* session,
@@ -1481,13 +1484,13 @@ HttpStreamFactoryImpl::Job* HttpStreamFactoryImpl::JobFactory::CreateAltSvcJob(
AlternativeService alternative_service,
bool enable_ip_based_pooling,
NetLog* net_log) {
- return new HttpStreamFactoryImpl::Job(
+ return base::MakeUnique<HttpStreamFactoryImpl::Job>(
delegate, job_type, session, request_info, priority, proxy_info,
server_ssl_config, proxy_ssl_config, destination, origin_url,
alternative_service, ProxyServer(), enable_ip_based_pooling, net_log);
}
-HttpStreamFactoryImpl::Job*
+std::unique_ptr<HttpStreamFactoryImpl::Job>
HttpStreamFactoryImpl::JobFactory::CreateAltProxyJob(
HttpStreamFactoryImpl::Job::Delegate* delegate,
HttpStreamFactoryImpl::JobType job_type,
@@ -1502,7 +1505,7 @@ HttpStreamFactoryImpl::JobFactory::CreateAltProxyJob(
const ProxyServer& alternative_proxy_server,
bool enable_ip_based_pooling,
NetLog* net_log) {
- return new HttpStreamFactoryImpl::Job(
+ return base::MakeUnique<HttpStreamFactoryImpl::Job>(
delegate, job_type, session, request_info, priority, proxy_info,
server_ssl_config, proxy_ssl_config, destination, origin_url,
AlternativeService(), alternative_proxy_server, enable_ip_based_pooling,
« no previous file with comments | « net/http/http_stream_factory_impl_job.h ('k') | net/http/http_stream_factory_impl_job_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698