Chromium Code Reviews

Side by Side Diff: net/http/http_stream_factory_impl_job.h

Issue 7289006: Basic HTTP pipelining support (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Simplify transaction unit tests Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
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 154 matching lines...)
191 192
192 // Moves this stream request into SPDY mode. 193 // Moves this stream request into SPDY mode.
193 void SwitchToSpdyMode(); 194 void SwitchToSpdyMode();
194 195
195 // Should we force SPDY to run over SSL for this stream request. 196 // Should we force SPDY to run over SSL for this stream request.
196 bool ShouldForceSpdySSL() const; 197 bool ShouldForceSpdySSL() const;
197 198
198 // Should we force SPDY to run without SSL for this stream request. 199 // Should we force SPDY to run without SSL for this stream request.
199 bool ShouldForceSpdyWithoutSSL() const; 200 bool ShouldForceSpdyWithoutSSL() const;
200 201
202 bool IsRequestEligibleForPipelining() const;
203
201 // Record histograms of latency until Connect() completes. 204 // Record histograms of latency until Connect() completes.
202 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle); 205 static void LogHttpConnectedMetrics(const ClientSocketHandle& handle);
203 206
204 void HACKCrashHereToDebug80095(); 207 void HACKCrashHereToDebug80095();
205 208
206 Request* request_; 209 Request* request_;
207 210
208 const HttpRequestInfo request_info_; 211 const HttpRequestInfo request_info_;
209 ProxyInfo proxy_info_; 212 ProxyInfo proxy_info_;
210 SSLConfig server_ssl_config_; 213 SSLConfig server_ssl_config_;
(...skipping 59 matching lines...)
270 273
271 // Initialized when we create a new SpdySession. 274 // Initialized when we create a new SpdySession.
272 scoped_refptr<SpdySession> new_spdy_session_; 275 scoped_refptr<SpdySession> new_spdy_session_;
273 276
274 // Initialized when we have an existing SpdySession. 277 // Initialized when we have an existing SpdySession.
275 scoped_refptr<SpdySession> existing_spdy_session_; 278 scoped_refptr<SpdySession> existing_spdy_session_;
276 279
277 // Only used if |new_spdy_session_| is non-NULL. 280 // Only used if |new_spdy_session_| is non-NULL.
278 bool spdy_session_direct_; 281 bool spdy_session_direct_;
279 282
283 // Initialized when an existing pipeline can handle this job's request.
284 HttpPipelinedConnection* existing_available_pipeline_;
285
280 ScopedRunnableMethodFactory<Job> method_factory_; 286 ScopedRunnableMethodFactory<Job> method_factory_;
281 287
282 DISALLOW_COPY_AND_ASSIGN(Job); 288 DISALLOW_COPY_AND_ASSIGN(Job);
283 }; 289 };
284 290
285 } // namespace net 291 } // namespace net
286 292
287 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ 293 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_
OLDNEW

Powered by Google App Engine