| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 6 #define NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| 7 | 7 |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
| 11 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" |
| 12 #include "net/base/net_log.h" | 12 #include "net/base/net_log.h" |
| 13 #include "net/base/request_priority.h" | 13 #include "net/base/request_priority.h" |
| 14 #include "net/http/http_auth.h" | 14 #include "net/http/http_auth.h" |
| 15 #include "net/http/http_auth_controller.h" | 15 #include "net/http/http_auth_controller.h" |
| 16 #include "net/http/http_pipelined_host.h" | |
| 17 #include "net/http/http_request_info.h" | 16 #include "net/http/http_request_info.h" |
| 18 #include "net/http/http_stream_factory_impl.h" | 17 #include "net/http/http_stream_factory_impl.h" |
| 19 #include "net/proxy/proxy_service.h" | 18 #include "net/proxy/proxy_service.h" |
| 20 #include "net/quic/quic_stream_factory.h" | 19 #include "net/quic/quic_stream_factory.h" |
| 21 #include "net/socket/client_socket_handle.h" | 20 #include "net/socket/client_socket_handle.h" |
| 22 #include "net/socket/ssl_client_socket.h" | 21 #include "net/socket/ssl_client_socket.h" |
| 23 #include "net/spdy/spdy_session_key.h" | 22 #include "net/spdy/spdy_session_key.h" |
| 24 #include "net/ssl/ssl_config_service.h" | 23 #include "net/ssl/ssl_config_service.h" |
| 25 | 24 |
| 26 namespace net { | 25 namespace net { |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 213 | 212 |
| 214 // Should we force SPDY to run over SSL for this stream request. | 213 // Should we force SPDY to run over SSL for this stream request. |
| 215 bool ShouldForceSpdySSL() const; | 214 bool ShouldForceSpdySSL() const; |
| 216 | 215 |
| 217 // Should we force SPDY to run without SSL for this stream request. | 216 // Should we force SPDY to run without SSL for this stream request. |
| 218 bool ShouldForceSpdyWithoutSSL() const; | 217 bool ShouldForceSpdyWithoutSSL() const; |
| 219 | 218 |
| 220 // Should we force QUIC for this stream request. | 219 // Should we force QUIC for this stream request. |
| 221 bool ShouldForceQuic() const; | 220 bool ShouldForceQuic() const; |
| 222 | 221 |
| 223 bool IsRequestEligibleForPipelining(); | |
| 224 | |
| 225 // Record histograms of latency until Connect() completes. | 222 // Record histograms of latency until Connect() completes. |
| 226 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle); | 223 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle); |
| 227 | 224 |
| 228 // Invoked by the transport socket pool after host resolution is complete | 225 // Invoked by the transport socket pool after host resolution is complete |
| 229 // to allow the connection to be aborted, if a matching SPDY session can | 226 // to allow the connection to be aborted, if a matching SPDY session can |
| 230 // be found. Will return ERR_SPDY_SESSION_ALREADY_EXISTS if such a | 227 // be found. Will return ERR_SPDY_SESSION_ALREADY_EXISTS if such a |
| 231 // session is found, and OK otherwise. | 228 // session is found, and OK otherwise. |
| 232 static int OnHostResolution(SpdySessionPool* spdy_session_pool, | 229 static int OnHostResolution(SpdySessionPool* spdy_session_pool, |
| 233 const SpdySessionKey& spdy_session_key, | 230 const SpdySessionKey& spdy_session_key, |
| 234 const AddressList& addresses, | 231 const AddressList& addresses, |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 | 315 |
| 319 // Initialized when we create a new SpdySession. | 316 // Initialized when we create a new SpdySession. |
| 320 base::WeakPtr<SpdySession> new_spdy_session_; | 317 base::WeakPtr<SpdySession> new_spdy_session_; |
| 321 | 318 |
| 322 // Initialized when we have an existing SpdySession. | 319 // Initialized when we have an existing SpdySession. |
| 323 base::WeakPtr<SpdySession> existing_spdy_session_; | 320 base::WeakPtr<SpdySession> existing_spdy_session_; |
| 324 | 321 |
| 325 // Only used if |new_spdy_session_| is non-NULL. | 322 // Only used if |new_spdy_session_| is non-NULL. |
| 326 bool spdy_session_direct_; | 323 bool spdy_session_direct_; |
| 327 | 324 |
| 328 // Key used to identify the HttpPipelinedHost for |request_|. | |
| 329 scoped_ptr<HttpPipelinedHost::Key> http_pipelining_key_; | |
| 330 | |
| 331 // True if an existing pipeline can handle this job's request. | |
| 332 bool existing_available_pipeline_; | |
| 333 | |
| 334 base::WeakPtrFactory<Job> ptr_factory_; | 325 base::WeakPtrFactory<Job> ptr_factory_; |
| 335 | 326 |
| 336 DISALLOW_COPY_AND_ASSIGN(Job); | 327 DISALLOW_COPY_AND_ASSIGN(Job); |
| 337 }; | 328 }; |
| 338 | 329 |
| 339 } // namespace net | 330 } // namespace net |
| 340 | 331 |
| 341 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 332 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| OLD | NEW |