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