Chromium Code Reviews| 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 48bfd1ddbf6f9d87ad0bd5a3cc3de8d4557795c6..dce6af34fa794897e04e3fe3d3380d77356d977c 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()), |
|
Ryan Hamilton
2017/05/09 19:22:06
Well that's a nice cleanup! I wonder what DefaultJ
Zhongyi Shi
2017/05/09 20:59:30
Ah, JobFactory used to be an interface, and produc
xunjieli
2017/05/10 00:26:23
Cherie is right. The interface seems to be created
|
| 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; |
| } |
| @@ -209,11 +142,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 { |