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/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/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_proxy_client_socket_pool.h" | |
16 #include "net/http/http_request_info.h" | 17 #include "net/http/http_request_info.h" |
17 #include "net/http/http_stream_factory_impl.h" | 18 #include "net/http/http_stream_factory_impl.h" |
18 #include "net/proxy/proxy_service.h" | 19 #include "net/proxy/proxy_service.h" |
19 #include "net/socket/client_socket_handle.h" | 20 #include "net/socket/client_socket_handle.h" |
20 #include "net/socket/ssl_client_socket.h" | 21 #include "net/socket/ssl_client_socket.h" |
21 | 22 |
22 namespace net { | 23 namespace net { |
23 | 24 |
24 class ClientSocketHandle; | 25 class ClientSocketHandle; |
25 class HttpAuthController; | 26 class HttpAuthController; |
(...skipping 14 matching lines...) Expand all Loading... | |
40 | 41 |
41 // Start initiates the process of creating a new HttpStream. |request| will be | 42 // Start initiates the process of creating a new HttpStream. |request| will be |
42 // notified upon completion if the Job has not been Orphan()'d. | 43 // notified upon completion if the Job has not been Orphan()'d. |
43 void Start(Request* request); | 44 void Start(Request* request); |
44 | 45 |
45 // Preconnect will attempt to request |num_streams| sockets from the | 46 // Preconnect will attempt to request |num_streams| sockets from the |
46 // appropriate ClientSocketPool. | 47 // appropriate ClientSocketPool. |
47 int Preconnect(int num_streams); | 48 int Preconnect(int num_streams); |
48 | 49 |
49 int RestartTunnelWithProxyAuth(const AuthCredentials& credentials); | 50 int RestartTunnelWithProxyAuth(const AuthCredentials& credentials); |
51 void ReallyRestartTunnelWithProxyAuth(); | |
vandebo (ex-Chrome)
2012/01/19 20:12:49
nit: These are usually named DoFoo
Ryan Hamilton
2012/01/19 23:11:19
Done. Though I thought DoFoo was typically reserv
vandebo (ex-Chrome)
2012/01/20 20:49:29
In the network code, the DoLoop methods all start
| |
52 | |
50 LoadState GetLoadState() const; | 53 LoadState GetLoadState() const; |
51 | 54 |
52 // Marks this Job as the "alternate" job, from Alternate-Protocol. Tracks the | 55 // Marks this Job as the "alternate" job, from Alternate-Protocol. Tracks the |
53 // original url so we can mark the Alternate-Protocol as broken if | 56 // original url so we can mark the Alternate-Protocol as broken if |
54 // we fail to connect. | 57 // we fail to connect. |
55 void MarkAsAlternate(const GURL& original_url); | 58 void MarkAsAlternate(const GURL& original_url); |
56 | 59 |
57 // Tells |this| to wait for |job| to resume it. | 60 // Tells |this| to wait for |job| to resume it. |
58 void WaitFor(Job* job); | 61 void WaitFor(Job* job); |
59 | 62 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
116 STATE_DONE, | 119 STATE_DONE, |
117 STATE_NONE | 120 STATE_NONE |
118 }; | 121 }; |
119 | 122 |
120 void OnStreamReadyCallback(); | 123 void OnStreamReadyCallback(); |
121 void OnSpdySessionReadyCallback(); | 124 void OnSpdySessionReadyCallback(); |
122 void OnStreamFailedCallback(int result); | 125 void OnStreamFailedCallback(int result); |
123 void OnCertificateErrorCallback(int result, const SSLInfo& ssl_info); | 126 void OnCertificateErrorCallback(int result, const SSLInfo& ssl_info); |
124 void OnNeedsProxyAuthCallback(const HttpResponseInfo& response_info, | 127 void OnNeedsProxyAuthCallback(const HttpResponseInfo& response_info, |
125 HttpAuthController* auth_controller); | 128 HttpAuthController* auth_controller); |
129 void OnNeedsProxyTunnelAuthCallback(const HttpResponseInfo& response_info, | |
130 HttpAuthController* auth_controller, | |
131 CompletionCallback callback); | |
126 void OnNeedsClientAuthCallback(SSLCertRequestInfo* cert_info); | 132 void OnNeedsClientAuthCallback(SSLCertRequestInfo* cert_info); |
127 void OnHttpsProxyTunnelResponseCallback(const HttpResponseInfo& response_info, | 133 void OnHttpsProxyTunnelResponseCallback(const HttpResponseInfo& response_info, |
128 HttpStream* stream); | 134 HttpStream* stream); |
129 void OnPreconnectsComplete(); | 135 void OnPreconnectsComplete(); |
130 | 136 |
131 void OnIOComplete(int result); | 137 void OnIOComplete(int result); |
132 int RunLoop(int result); | 138 int RunLoop(int result); |
133 int DoLoop(int result); | 139 int DoLoop(int result); |
134 int StartInternal(); | 140 int StartInternal(); |
135 | 141 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 | 252 |
247 // Force spdy only for SSL connections. | 253 // Force spdy only for SSL connections. |
248 bool force_spdy_over_ssl_; | 254 bool force_spdy_over_ssl_; |
249 | 255 |
250 // The certificate error while using SPDY over SSL for insecure URLs. | 256 // The certificate error while using SPDY over SSL for insecure URLs. |
251 int spdy_certificate_error_; | 257 int spdy_certificate_error_; |
252 | 258 |
253 scoped_refptr<HttpAuthController> | 259 scoped_refptr<HttpAuthController> |
254 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS]; | 260 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS]; |
255 | 261 |
262 // Invoked after a request for tunnel auth has been handled. | |
263 CompletionCallback tunnel_auth_handled_callback_; | |
264 | |
256 // True when the tunnel is in the process of being established - we can't | 265 // True when the tunnel is in the process of being established - we can't |
257 // read from the socket until the tunnel is done. | 266 // read from the socket until the tunnel is done. |
258 bool establishing_tunnel_; | 267 bool establishing_tunnel_; |
259 | 268 |
260 scoped_ptr<HttpStream> stream_; | 269 scoped_ptr<HttpStream> stream_; |
261 | 270 |
262 // True if we negotiated NPN. | 271 // True if we negotiated NPN. |
263 bool was_npn_negotiated_; | 272 bool was_npn_negotiated_; |
264 | 273 |
265 // Protocol negotiated with the server. | 274 // Protocol negotiated with the server. |
(...skipping 16 matching lines...) Expand all Loading... | |
282 bool existing_available_pipeline_; | 291 bool existing_available_pipeline_; |
283 | 292 |
284 base::WeakPtrFactory<Job> ptr_factory_; | 293 base::WeakPtrFactory<Job> ptr_factory_; |
285 | 294 |
286 DISALLOW_COPY_AND_ASSIGN(Job); | 295 DISALLOW_COPY_AND_ASSIGN(Job); |
287 }; | 296 }; |
288 | 297 |
289 } // namespace net | 298 } // namespace net |
290 | 299 |
291 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ | 300 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ |
OLD | NEW |