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

Unified Diff: net/http/http_stream_factory_impl.cc

Issue 2814633003: Extract Proxy Resolution out of HttpStreamFactoryImpl::Job (Closed)
Patch Set: rebased 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_unittest.cc ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_stream_factory_impl.cc
diff --git a/net/http/http_stream_factory_impl.cc b/net/http/http_stream_factory_impl.cc
index 669f04fdbbe93aea47312a1abb141a1a3d4c2cb1..c1b6eadc86ab4bdb8422a79cf39b308dd43e57cd 100644
--- a/net/http/http_stream_factory_impl.cc
+++ b/net/http/http_stream_factory_impl.cc
@@ -32,77 +32,10 @@
namespace net {
-namespace {
-// Default JobFactory for creating HttpStreamFactoryImpl::Jobs.
-class DefaultJobFactory : public HttpStreamFactoryImpl::JobFactory {
- public:
- DefaultJobFactory() {}
-
- ~DefaultJobFactory() override {}
-
- HttpStreamFactoryImpl::Job* CreateJob(
- HttpStreamFactoryImpl::Job::Delegate* delegate,
- HttpStreamFactoryImpl::JobType job_type,
- HttpNetworkSession* session,
- const HttpRequestInfo& request_info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config,
- HostPortPair destination,
- GURL origin_url,
- bool enable_ip_based_pooling,
- NetLog* net_log) override {
- return new HttpStreamFactoryImpl::Job(
- delegate, job_type, session, request_info, priority, server_ssl_config,
- proxy_ssl_config, destination, origin_url, enable_ip_based_pooling,
- net_log);
- }
-
- HttpStreamFactoryImpl::Job* CreateJob(
- HttpStreamFactoryImpl::Job::Delegate* delegate,
- HttpStreamFactoryImpl::JobType job_type,
- HttpNetworkSession* session,
- const HttpRequestInfo& request_info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config,
- HostPortPair destination,
- GURL origin_url,
- AlternativeService alternative_service,
- bool enable_ip_based_pooling,
- NetLog* net_log) override {
- return new HttpStreamFactoryImpl::Job(
- delegate, job_type, session, request_info, priority, server_ssl_config,
- proxy_ssl_config, destination, origin_url, alternative_service,
- ProxyServer(), enable_ip_based_pooling, net_log);
- }
-
- HttpStreamFactoryImpl::Job* CreateJob(
- HttpStreamFactoryImpl::Job::Delegate* delegate,
- HttpStreamFactoryImpl::JobType job_type,
- HttpNetworkSession* session,
- const HttpRequestInfo& request_info,
- RequestPriority priority,
- const SSLConfig& server_ssl_config,
- const SSLConfig& proxy_ssl_config,
- HostPortPair destination,
- GURL origin_url,
- const ProxyServer& alternative_proxy_server,
- bool enable_ip_based_pooling,
- NetLog* net_log) override {
- return new HttpStreamFactoryImpl::Job(
- delegate, job_type, session, request_info, priority, server_ssl_config,
- proxy_ssl_config, destination, origin_url, AlternativeService(),
- alternative_proxy_server, enable_ip_based_pooling, net_log);
- }
-};
-
-} // anonymous namespace
-
HttpStreamFactoryImpl::HttpStreamFactoryImpl(HttpNetworkSession* session,
bool for_websockets)
: session_(session),
- job_factory_(new DefaultJobFactory()),
+ job_factory_(new JobFactory()),
for_websockets_(for_websockets),
last_logged_job_controller_count_(0) {}
@@ -181,12 +114,12 @@ HttpStreamRequest* HttpStreamFactoryImpl::RequestStreamInternal(
auto job_controller = base::MakeUnique<JobController>(
this, delegate, session_, job_factory_.get(), request_info,
/* is_preconnect = */ false, enable_ip_based_pooling,
- enable_alternative_services);
+ enable_alternative_services, server_ssl_config, proxy_ssl_config);
JobController* job_controller_raw_ptr = job_controller.get();
job_controller_set_.insert(std::move(job_controller));
Request* request = job_controller_raw_ptr->Start(
- request_info, delegate, websocket_handshake_stream_create_helper, net_log,
- stream_type, priority, server_ssl_config, proxy_ssl_config);
+ delegate, websocket_handshake_stream_create_helper, net_log, stream_type,
+ priority);
return request;
}
@@ -211,11 +144,11 @@ void HttpStreamFactoryImpl::PreconnectStreams(
this, nullptr, session_, job_factory_.get(), request_info,
/* is_preconnect = */ true,
/* enable_ip_based_pooling = */ true,
- /* enable_alternative_services = */ true);
+ /* enable_alternative_services = */ true, server_ssl_config,
+ proxy_ssl_config);
JobController* job_controller_raw_ptr = job_controller.get();
job_controller_set_.insert(std::move(job_controller));
- job_controller_raw_ptr->Preconnect(num_streams, request_info,
- server_ssl_config, proxy_ssl_config);
+ job_controller_raw_ptr->Preconnect(num_streams);
}
const HostMappingRules* HttpStreamFactoryImpl::GetHostMappingRules() const {
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/http/http_stream_factory_impl_job.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698