| 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 20 matching lines...) Expand all Loading... |
| 31 | 31 |
| 32 GURL ApplyHostMappingRules(const GURL& url, HostPortPair* endpoint); | 32 GURL ApplyHostMappingRules(const GURL& url, HostPortPair* endpoint); |
| 33 | 33 |
| 34 // Methods below are called by HttpStreamFactoryImpl only. | 34 // Methods below are called by HttpStreamFactoryImpl only. |
| 35 // Creates request and hands out to HttpStreamFactoryImpl, this will also | 35 // Creates request and hands out to HttpStreamFactoryImpl, this will also |
| 36 // create Job(s) and start serving the created request. | 36 // create Job(s) and start serving the created request. |
| 37 Request* Start(const HttpRequestInfo& request_info, | 37 Request* Start(const HttpRequestInfo& request_info, |
| 38 HttpStreamRequest::Delegate* delegate, | 38 HttpStreamRequest::Delegate* delegate, |
| 39 WebSocketHandshakeStreamBase::CreateHelper* | 39 WebSocketHandshakeStreamBase::CreateHelper* |
| 40 websocket_handshake_stream_create_helper, | 40 websocket_handshake_stream_create_helper, |
| 41 const BoundNetLog& net_log, | 41 const NetLogWithSource& net_log, |
| 42 HttpStreamRequest::StreamType stream_type, | 42 HttpStreamRequest::StreamType stream_type, |
| 43 RequestPriority priority, | 43 RequestPriority priority, |
| 44 const SSLConfig& server_ssl_config, | 44 const SSLConfig& server_ssl_config, |
| 45 const SSLConfig& proxy_ssl_config); | 45 const SSLConfig& proxy_ssl_config); |
| 46 | 46 |
| 47 void Preconnect(int num_streams, | 47 void Preconnect(int num_streams, |
| 48 const HttpRequestInfo& request_info, | 48 const HttpRequestInfo& request_info, |
| 49 const SSLConfig& server_ssl_config, | 49 const SSLConfig& server_ssl_config, |
| 50 const SSLConfig& proxy_ssl_config); | 50 const SSLConfig& proxy_ssl_config); |
| 51 | 51 |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 | 151 |
| 152 // Called when |job| determines the appropriate |spdy_session_key| for the | 152 // Called when |job| determines the appropriate |spdy_session_key| for the |
| 153 // Request. Note that this does not mean that SPDY is necessarily supported | 153 // Request. Note that this does not mean that SPDY is necessarily supported |
| 154 // for this SpdySessionKey, since we may need to wait for NPN to complete | 154 // for this SpdySessionKey, since we may need to wait for NPN to complete |
| 155 // before knowing if SPDY is available. | 155 // before knowing if SPDY is available. |
| 156 void SetSpdySessionKey(Job* job, | 156 void SetSpdySessionKey(Job* job, |
| 157 const SpdySessionKey& spdy_session_key) override; | 157 const SpdySessionKey& spdy_session_key) override; |
| 158 | 158 |
| 159 // Remove session from the SpdySessionRequestMap. | 159 // Remove session from the SpdySessionRequestMap. |
| 160 void RemoveRequestFromSpdySessionRequestMapForJob(Job* job) override; | 160 void RemoveRequestFromSpdySessionRequestMapForJob(Job* job) override; |
| 161 const BoundNetLog* GetNetLog(Job* job) const override; | 161 const NetLogWithSource* GetNetLog(Job* job) const override; |
| 162 | 162 |
| 163 void MaybeSetWaitTimeForMainJob(const base::TimeDelta& delay) override; | 163 void MaybeSetWaitTimeForMainJob(const base::TimeDelta& delay) override; |
| 164 | 164 |
| 165 WebSocketHandshakeStreamBase::CreateHelper* | 165 WebSocketHandshakeStreamBase::CreateHelper* |
| 166 websocket_handshake_stream_create_helper() override; | 166 websocket_handshake_stream_create_helper() override; |
| 167 | 167 |
| 168 private: | 168 private: |
| 169 friend class JobControllerPeer; | 169 friend class JobControllerPeer; |
| 170 | 170 |
| 171 // Creates Job(s) for |request_|. Job(s) will be owned by |this|. | 171 // Creates Job(s) for |request_|. Job(s) will be owned by |this|. |
| 172 void CreateJobs(const HttpRequestInfo& request_info, | 172 void CreateJobs(const HttpRequestInfo& request_info, |
| 173 RequestPriority priority, | 173 RequestPriority priority, |
| 174 const SSLConfig& server_ssl_config, | 174 const SSLConfig& server_ssl_config, |
| 175 const SSLConfig& proxy_ssl_config, | 175 const SSLConfig& proxy_ssl_config, |
| 176 HttpStreamRequest::Delegate* delegate, | 176 HttpStreamRequest::Delegate* delegate, |
| 177 HttpStreamRequest::StreamType stream_type, | 177 HttpStreamRequest::StreamType stream_type, |
| 178 const BoundNetLog& net_log); | 178 const NetLogWithSource& net_log); |
| 179 | 179 |
| 180 // Attaches |job| to |request_|. Does not mean that |request_| will use |job|. | 180 // Attaches |job| to |request_|. Does not mean that |request_| will use |job|. |
| 181 void AttachJob(Job* job); | 181 void AttachJob(Job* job); |
| 182 | 182 |
| 183 // Called to bind |job| to the |request_| and orphan all other jobs that are | 183 // Called to bind |job| to the |request_| and orphan all other jobs that are |
| 184 // still associated with |request_|. | 184 // still associated with |request_|. |
| 185 void BindJob(Job* job); | 185 void BindJob(Job* job); |
| 186 | 186 |
| 187 // Called when |request_| is destructed. | 187 // Called when |request_| is destructed. |
| 188 // Job(s) associated with but not bound to |request_| will be deleted. | 188 // Job(s) associated with but not bound to |request_| will be deleted. |
| (...skipping 104 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 |