| OLD | NEW |
| 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/http/http_stream_factory_test_util.h" | 5 #include "net/http/http_stream_factory_test_util.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "net/proxy/proxy_info.h" | 9 #include "net/proxy/proxy_info.h" |
| 10 | 10 |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 HttpStreamFactoryImpl::Job::Delegate* delegate, | 47 HttpStreamFactoryImpl::Job::Delegate* delegate, |
| 48 HttpStreamFactoryImpl::JobType job_type, | 48 HttpStreamFactoryImpl::JobType job_type, |
| 49 HttpNetworkSession* session, | 49 HttpNetworkSession* session, |
| 50 const HttpRequestInfo& request_info, | 50 const HttpRequestInfo& request_info, |
| 51 RequestPriority priority, | 51 RequestPriority priority, |
| 52 ProxyInfo proxy_info, | 52 ProxyInfo proxy_info, |
| 53 const SSLConfig& server_ssl_config, | 53 const SSLConfig& server_ssl_config, |
| 54 const SSLConfig& proxy_ssl_config, | 54 const SSLConfig& proxy_ssl_config, |
| 55 HostPortPair destination, | 55 HostPortPair destination, |
| 56 GURL origin_url, | 56 GURL origin_url, |
| 57 AlternativeService alternative_service, | 57 const AlternativeServiceInfo& alternative_service_info, |
| 58 const ProxyServer& alternative_proxy_server, | 58 const ProxyServer& alternative_proxy_server, |
| 59 bool enable_ip_based_pooling, | 59 bool enable_ip_based_pooling, |
| 60 NetLog* net_log) | 60 NetLog* net_log) |
| 61 : HttpStreamFactoryImpl::Job(delegate, | 61 : HttpStreamFactoryImpl::Job(delegate, |
| 62 job_type, | 62 job_type, |
| 63 session, | 63 session, |
| 64 request_info, | 64 request_info, |
| 65 priority, | 65 priority, |
| 66 proxy_info, | 66 proxy_info, |
| 67 server_ssl_config, | 67 server_ssl_config, |
| 68 proxy_ssl_config, | 68 proxy_ssl_config, |
| 69 destination, | 69 destination, |
| 70 origin_url, | 70 origin_url, |
| 71 alternative_service, | 71 alternative_service_info, |
| 72 alternative_proxy_server, | 72 alternative_proxy_server, |
| 73 enable_ip_based_pooling, | 73 enable_ip_based_pooling, |
| 74 net_log) {} | 74 net_log) {} |
| 75 | 75 |
| 76 MockHttpStreamFactoryImplJob::~MockHttpStreamFactoryImplJob() {} | 76 MockHttpStreamFactoryImplJob::~MockHttpStreamFactoryImplJob() {} |
| 77 | 77 |
| 78 TestJobFactory::TestJobFactory() | 78 TestJobFactory::TestJobFactory() |
| 79 : main_job_(nullptr), | 79 : main_job_(nullptr), |
| 80 alternative_job_(nullptr), | 80 alternative_job_(nullptr), |
| 81 override_main_job_url_(false) {} | 81 override_main_job_url_(false) {} |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 HttpStreamFactoryImpl::Job::Delegate* delegate, | 113 HttpStreamFactoryImpl::Job::Delegate* delegate, |
| 114 HttpStreamFactoryImpl::JobType job_type, | 114 HttpStreamFactoryImpl::JobType job_type, |
| 115 HttpNetworkSession* session, | 115 HttpNetworkSession* session, |
| 116 const HttpRequestInfo& request_info, | 116 const HttpRequestInfo& request_info, |
| 117 RequestPriority priority, | 117 RequestPriority priority, |
| 118 const ProxyInfo& proxy_info, | 118 const ProxyInfo& proxy_info, |
| 119 const SSLConfig& server_ssl_config, | 119 const SSLConfig& server_ssl_config, |
| 120 const SSLConfig& proxy_ssl_config, | 120 const SSLConfig& proxy_ssl_config, |
| 121 HostPortPair destination, | 121 HostPortPair destination, |
| 122 GURL origin_url, | 122 GURL origin_url, |
| 123 AlternativeService alternative_service, | 123 const AlternativeServiceInfo& alternative_service_info, |
| 124 bool enable_ip_based_pooling, | 124 bool enable_ip_based_pooling, |
| 125 NetLog* net_log) { | 125 NetLog* net_log) { |
| 126 auto alternative_job = base::MakeUnique<MockHttpStreamFactoryImplJob>( | 126 auto alternative_job = base::MakeUnique<MockHttpStreamFactoryImplJob>( |
| 127 delegate, job_type, session, request_info, priority, proxy_info, | 127 delegate, job_type, session, request_info, priority, proxy_info, |
| 128 SSLConfig(), SSLConfig(), destination, origin_url, alternative_service, | 128 SSLConfig(), SSLConfig(), destination, origin_url, |
| 129 ProxyServer(), enable_ip_based_pooling, nullptr); | 129 alternative_service_info, ProxyServer(), enable_ip_based_pooling, |
| 130 nullptr); |
| 130 | 131 |
| 131 // Keep raw pointer to Job but pass ownership. | 132 // Keep raw pointer to Job but pass ownership. |
| 132 alternative_job_ = alternative_job.get(); | 133 alternative_job_ = alternative_job.get(); |
| 133 | 134 |
| 134 return std::move(alternative_job); | 135 return std::move(alternative_job); |
| 135 } | 136 } |
| 136 | 137 |
| 137 std::unique_ptr<HttpStreamFactoryImpl::Job> TestJobFactory::CreateAltProxyJob( | 138 std::unique_ptr<HttpStreamFactoryImpl::Job> TestJobFactory::CreateAltProxyJob( |
| 138 HttpStreamFactoryImpl::Job::Delegate* delegate, | 139 HttpStreamFactoryImpl::Job::Delegate* delegate, |
| 139 HttpStreamFactoryImpl::JobType job_type, | 140 HttpStreamFactoryImpl::JobType job_type, |
| 140 HttpNetworkSession* session, | 141 HttpNetworkSession* session, |
| 141 const HttpRequestInfo& request_info, | 142 const HttpRequestInfo& request_info, |
| 142 RequestPriority priority, | 143 RequestPriority priority, |
| 143 const ProxyInfo& proxy_info, | 144 const ProxyInfo& proxy_info, |
| 144 const SSLConfig& server_ssl_config, | 145 const SSLConfig& server_ssl_config, |
| 145 const SSLConfig& proxy_ssl_config, | 146 const SSLConfig& proxy_ssl_config, |
| 146 HostPortPair destination, | 147 HostPortPair destination, |
| 147 GURL origin_url, | 148 GURL origin_url, |
| 148 const ProxyServer& alternative_proxy_server, | 149 const ProxyServer& alternative_proxy_server, |
| 149 bool enable_ip_based_pooling, | 150 bool enable_ip_based_pooling, |
| 150 NetLog* net_log) { | 151 NetLog* net_log) { |
| 151 auto alternative_job = base::MakeUnique<MockHttpStreamFactoryImplJob>( | 152 auto alternative_job = base::MakeUnique<MockHttpStreamFactoryImplJob>( |
| 152 delegate, job_type, session, request_info, priority, proxy_info, | 153 delegate, job_type, session, request_info, priority, proxy_info, |
| 153 SSLConfig(), SSLConfig(), destination, origin_url, AlternativeService(), | 154 SSLConfig(), SSLConfig(), destination, origin_url, |
| 154 alternative_proxy_server, enable_ip_based_pooling, nullptr); | 155 AlternativeServiceInfo(), alternative_proxy_server, |
| 156 enable_ip_based_pooling, nullptr); |
| 155 | 157 |
| 156 // Keep raw pointer to Job but pass ownership. | 158 // Keep raw pointer to Job but pass ownership. |
| 157 alternative_job_ = alternative_job.get(); | 159 alternative_job_ = alternative_job.get(); |
| 158 | 160 |
| 159 return std::move(alternative_job); | 161 return std::move(alternative_job); |
| 160 } | 162 } |
| 161 | 163 |
| 162 } // namespace net | 164 } // namespace net |
| OLD | NEW |