| 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 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ |
| 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "net/base/host_port_pair.h" | 8 #include "net/base/host_port_pair.h" |
| 9 #include "net/http/http_stream_factory_impl_job.h" | 9 #include "net/http/http_stream_factory_impl_job.h" |
| 10 #include "net/http/http_stream_factory_impl_request.h" | 10 #include "net/http/http_stream_factory_impl_request.h" |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 234 // Returns true if the |request_| can be fetched via an alternative | 234 // Returns true if the |request_| can be fetched via an alternative |
| 235 // proxy server, and sets |alternative_proxy_server| to the available | 235 // proxy server, and sets |alternative_proxy_server| to the available |
| 236 // alternative proxy server. |alternative_proxy_server| should not be null, | 236 // alternative proxy server. |alternative_proxy_server| should not be null, |
| 237 // and is owned by the caller. | 237 // and is owned by the caller. |
| 238 bool ShouldCreateAlternativeProxyServerJob( | 238 bool ShouldCreateAlternativeProxyServerJob( |
| 239 Job* job, | 239 Job* job, |
| 240 const ProxyInfo& proxy_info_, | 240 const ProxyInfo& proxy_info_, |
| 241 const GURL& url, | 241 const GURL& url, |
| 242 ProxyServer* alternative_proxy_server) const; | 242 ProxyServer* alternative_proxy_server) const; |
| 243 | 243 |
| 244 // Records histogram metrics for the usage of alternative proxy server. Must | 244 // Records histogram metrics for the usage of alternative protocol. Must be |
| 245 // be called when |job| has succeeded, and some other jobs will be orphaned. | 245 // called when |job| has succeeded and the other job will be orphaned. |
| 246 void MaybeRecordAlternativeProxyServerUsage(Job* job) const; | 246 void ReportAlternateProtocolUsage(Job* job) const; |
| 247 | 247 |
| 248 // Starts the |alternative_job_|. | 248 // Starts the |alternative_job_|. |
| 249 void StartAlternativeProxyServerJob(); | 249 void StartAlternativeProxyServerJob(); |
| 250 | 250 |
| 251 HttpStreamFactoryImpl* factory_; | 251 HttpStreamFactoryImpl* factory_; |
| 252 HttpNetworkSession* session_; | 252 HttpNetworkSession* session_; |
| 253 JobFactory* job_factory_; | 253 JobFactory* job_factory_; |
| 254 | 254 |
| 255 // Request will be handed out to factory once created. This just keeps an | 255 // Request will be handed out to factory once created. This just keeps an |
| 256 // reference and is safe as |request_| will notify |this| JobController | 256 // reference and is safe as |request_| will notify |this| JobController |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 293 | 293 |
| 294 // True if an alternative proxy server job can be started to fetch |request_|. | 294 // True if an alternative proxy server job can be started to fetch |request_|. |
| 295 bool can_start_alternative_proxy_job_; | 295 bool can_start_alternative_proxy_job_; |
| 296 | 296 |
| 297 base::WeakPtrFactory<JobController> ptr_factory_; | 297 base::WeakPtrFactory<JobController> ptr_factory_; |
| 298 }; | 298 }; |
| 299 | 299 |
| 300 } // namespace net | 300 } // namespace net |
| 301 | 301 |
| 302 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ | 302 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_CONTROLLER_H_ |
| OLD | NEW |