OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/task.h" | 10 #include "base/task.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/ssl_config_service.h" | 13 #include "net/base/ssl_config_service.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_request_info.h" | 16 #include "net/http/http_request_info.h" |
17 #include "net/http/http_stream_factory_impl.h" | 17 #include "net/http/http_stream_factory_impl.h" |
18 #include "net/proxy/proxy_service.h" | 18 #include "net/proxy/proxy_service.h" |
19 #include "net/socket/client_socket_handle.h" | 19 #include "net/socket/client_socket_handle.h" |
20 | 20 |
21 namespace net { | 21 namespace net { |
22 | 22 |
23 class ClientSocketHandle; | 23 class ClientSocketHandle; |
24 class HttpAuthController; | 24 class HttpAuthController; |
25 class HttpNetworkSession; | 25 class HttpNetworkSession; |
| 26 class HttpPipelinedConnection; |
26 class HttpProxySocketParams; | 27 class HttpProxySocketParams; |
27 class HttpStream; | 28 class HttpStream; |
28 class SOCKSSocketParams; | 29 class SOCKSSocketParams; |
29 class SSLSocketParams; | 30 class SSLSocketParams; |
30 class TransportSocketParams; | 31 class TransportSocketParams; |
31 | 32 |
32 // An HttpStreamRequestImpl exists for each stream which is in progress of being | 33 // An HttpStreamRequestImpl exists for each stream which is in progress of being |
33 // created for the StreamFactory. | 34 // created for the StreamFactory. |
34 class HttpStreamFactoryImpl::Job { | 35 class HttpStreamFactoryImpl::Job { |
35 public: | 36 public: |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 191 |
191 // Moves this stream request into SPDY mode. | 192 // Moves this stream request into SPDY mode. |
192 void SwitchToSpdyMode(); | 193 void SwitchToSpdyMode(); |
193 | 194 |
194 // Should we force SPDY to run over SSL for this stream request. | 195 // Should we force SPDY to run over SSL for this stream request. |
195 bool ShouldForceSpdySSL() const; | 196 bool ShouldForceSpdySSL() const; |
196 | 197 |
197 // Should we force SPDY to run without SSL for this stream request. | 198 // Should we force SPDY to run without SSL for this stream request. |
198 bool ShouldForceSpdyWithoutSSL() const; | 199 bool ShouldForceSpdyWithoutSSL() const; |
199 | 200 |
| 201 bool IsRequestEligibleForPipelining() const; |
| 202 |
200 // Record histograms of latency until Connect() completes. | 203 // Record histograms of latency until Connect() completes. |
201 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle); | 204 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle); |
202 | 205 |
203 void HACKCrashHereToDebug80095(); | |
204 | |
205 Request* request_; | 206 Request* request_; |
206 | 207 |
207 const HttpRequestInfo request_info_; | 208 const HttpRequestInfo request_info_; |
208 ProxyInfo proxy_info_; | 209 ProxyInfo proxy_info_; |
209 SSLConfig server_ssl_config_; | 210 SSLConfig server_ssl_config_; |
210 SSLConfig proxy_ssl_config_; | 211 SSLConfig proxy_ssl_config_; |
211 const BoundNetLog net_log_; | 212 const BoundNetLog net_log_; |
212 | 213 |
213 OldCompletionCallbackImpl<Job> io_callback_; | 214 OldCompletionCallbackImpl<Job> io_callback_; |
214 scoped_ptr<ClientSocketHandle> connection_; | 215 scoped_ptr<ClientSocketHandle> connection_; |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 | 270 |
270 // Initialized when we create a new SpdySession. | 271 // Initialized when we create a new SpdySession. |
271 scoped_refptr<SpdySession> new_spdy_session_; | 272 scoped_refptr<SpdySession> new_spdy_session_; |
272 | 273 |
273 // Initialized when we have an existing SpdySession. | 274 // Initialized when we have an existing SpdySession. |
274 scoped_refptr<SpdySession> existing_spdy_session_; | 275 scoped_refptr<SpdySession> existing_spdy_session_; |
275 | 276 |
276 // Only used if |new_spdy_session_| is non-NULL. | 277 // Only used if |new_spdy_session_| is non-NULL. |
277 bool spdy_session_direct_; | 278 bool spdy_session_direct_; |
278 | 279 |
| 280 // True if an existing pipeline can handle this job's request. |
| 281 bool existing_available_pipeline_; |
| 282 |
279 ScopedRunnableMethodFactory<Job> method_factory_; | 283 ScopedRunnableMethodFactory<Job> method_factory_; |
280 | 284 |
281 DISALLOW_COPY_AND_ASSIGN(Job); | 285 DISALLOW_COPY_AND_ASSIGN(Job); |
282 }; | 286 }; |
283 | 287 |
284 } // namespace net | 288 } // namespace net |
285 | 289 |
286 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 290 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
OLD | NEW |