| 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 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 222 |
| 224 // Should we force SPDY to run over SSL for this stream request. | 223 // Should we force SPDY to run over SSL for this stream request. |
| 225 bool ShouldForceSpdySSL() const; | 224 bool ShouldForceSpdySSL() const; |
| 226 | 225 |
| 227 // Should we force SPDY to run without SSL for this stream request. | 226 // Should we force SPDY to run without SSL for this stream request. |
| 228 bool ShouldForceSpdyWithoutSSL() const; | 227 bool ShouldForceSpdyWithoutSSL() const; |
| 229 | 228 |
| 230 // Should we force QUIC for this stream request. | 229 // Should we force QUIC for this stream request. |
| 231 bool ShouldForceQuic() const; | 230 bool ShouldForceQuic() const; |
| 232 | 231 |
| 233 bool IsRequestEligibleForPipelining(); | |
| 234 | |
| 235 void MaybeMarkAlternateProtocolBroken(); | 232 void MaybeMarkAlternateProtocolBroken(); |
| 236 | 233 |
| 237 // Record histograms of latency until Connect() completes. | 234 // Record histograms of latency until Connect() completes. |
| 238 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle); | 235 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle); |
| 239 | 236 |
| 240 // Invoked by the transport socket pool after host resolution is complete | 237 // Invoked by the transport socket pool after host resolution is complete |
| 241 // to allow the connection to be aborted, if a matching SPDY session can | 238 // to allow the connection to be aborted, if a matching SPDY session can |
| 242 // be found. Will return ERR_SPDY_SESSION_ALREADY_EXISTS if such a | 239 // be found. Will return ERR_SPDY_SESSION_ALREADY_EXISTS if such a |
| 243 // session is found, and OK otherwise. | 240 // session is found, and OK otherwise. |
| 244 static int OnHostResolution(SpdySessionPool* spdy_session_pool, | 241 static int OnHostResolution(SpdySessionPool* spdy_session_pool, |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 | 321 |
| 325 // Initialized when we create a new SpdySession. | 322 // Initialized when we create a new SpdySession. |
| 326 base::WeakPtr<SpdySession> new_spdy_session_; | 323 base::WeakPtr<SpdySession> new_spdy_session_; |
| 327 | 324 |
| 328 // Initialized when we have an existing SpdySession. | 325 // Initialized when we have an existing SpdySession. |
| 329 base::WeakPtr<SpdySession> existing_spdy_session_; | 326 base::WeakPtr<SpdySession> existing_spdy_session_; |
| 330 | 327 |
| 331 // Only used if |new_spdy_session_| is non-NULL. | 328 // Only used if |new_spdy_session_| is non-NULL. |
| 332 bool spdy_session_direct_; | 329 bool spdy_session_direct_; |
| 333 | 330 |
| 334 // Key used to identify the HttpPipelinedHost for |request_|. | |
| 335 scoped_ptr<HttpPipelinedHost::Key> http_pipelining_key_; | |
| 336 | |
| 337 // True if an existing pipeline can handle this job's request. | |
| 338 bool existing_available_pipeline_; | |
| 339 | |
| 340 JobStatus job_status_; | 331 JobStatus job_status_; |
| 341 JobStatus other_job_status_; | 332 JobStatus other_job_status_; |
| 342 | 333 |
| 343 base::WeakPtrFactory<Job> ptr_factory_; | 334 base::WeakPtrFactory<Job> ptr_factory_; |
| 344 | 335 |
| 345 DISALLOW_COPY_AND_ASSIGN(Job); | 336 DISALLOW_COPY_AND_ASSIGN(Job); |
| 346 }; | 337 }; |
| 347 | 338 |
| 348 } // namespace net | 339 } // namespace net |
| 349 | 340 |
| 350 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 341 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
| OLD | NEW |