Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

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

Issue 9148011: Allow chrome to handle 407 auth challenges to CONNECT requests (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « net/http/http_proxy_utils.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/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 13 matching lines...) Expand all
39 ~Job(); 40 ~Job();
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();
51
50 LoadState GetLoadState() const; 52 LoadState GetLoadState() const;
51 53
52 // Marks this Job as the "alternate" job, from Alternate-Protocol. Tracks the 54 // 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 55 // original url so we can mark the Alternate-Protocol as broken if
54 // we fail to connect. 56 // we fail to connect.
55 void MarkAsAlternate(const GURL& original_url); 57 void MarkAsAlternate(const GURL& original_url);
56 58
57 // Tells |this| to wait for |job| to resume it. 59 // Tells |this| to wait for |job| to resume it.
58 void WaitFor(Job* job); 60 void WaitFor(Job* job);
59 61
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 STATE_DONE, 118 STATE_DONE,
117 STATE_NONE 119 STATE_NONE
118 }; 120 };
119 121
120 void OnStreamReadyCallback(); 122 void OnStreamReadyCallback();
121 void OnSpdySessionReadyCallback(); 123 void OnSpdySessionReadyCallback();
122 void OnStreamFailedCallback(int result); 124 void OnStreamFailedCallback(int result);
123 void OnCertificateErrorCallback(int result, const SSLInfo& ssl_info); 125 void OnCertificateErrorCallback(int result, const SSLInfo& ssl_info);
124 void OnNeedsProxyAuthCallback(const HttpResponseInfo& response_info, 126 void OnNeedsProxyAuthCallback(const HttpResponseInfo& response_info,
125 HttpAuthController* auth_controller); 127 HttpAuthController* auth_controller);
128 void OnNeedsProxyTunnelAuthCallback(const HttpResponseInfo& response_info,
129 HttpAuthController* auth_controller,
130 CompletionCallback callback);
126 void OnNeedsClientAuthCallback(SSLCertRequestInfo* cert_info); 131 void OnNeedsClientAuthCallback(SSLCertRequestInfo* cert_info);
127 void OnHttpsProxyTunnelResponseCallback(const HttpResponseInfo& response_info, 132 void OnHttpsProxyTunnelResponseCallback(const HttpResponseInfo& response_info,
128 HttpStream* stream); 133 HttpStream* stream);
129 void OnPreconnectsComplete(); 134 void OnPreconnectsComplete();
130 135
131 void OnIOComplete(int result); 136 void OnIOComplete(int result);
132 int RunLoop(int result); 137 int RunLoop(int result);
133 int DoLoop(int result); 138 int DoLoop(int result);
134 int StartInternal(); 139 int StartInternal();
135 140
(...skipping 10 matching lines...) Expand all
146 int DoInitConnectionComplete(int result); 151 int DoInitConnectionComplete(int result);
147 int DoWaitingUserAction(int result); 152 int DoWaitingUserAction(int result);
148 int DoCreateStream(); 153 int DoCreateStream();
149 int DoCreateStreamComplete(int result); 154 int DoCreateStreamComplete(int result);
150 int DoRestartTunnelAuth(); 155 int DoRestartTunnelAuth();
151 int DoRestartTunnelAuthComplete(int result); 156 int DoRestartTunnelAuthComplete(int result);
152 157
153 // Returns to STATE_INIT_CONNECTION and resets some state. 158 // Returns to STATE_INIT_CONNECTION and resets some state.
154 void ReturnToStateInitConnection(bool close_connection); 159 void ReturnToStateInitConnection(bool close_connection);
155 160
161 void DoRestartTunnelWithProxyAuth();
162
156 // Set the motivation for this request onto the underlying socket. 163 // Set the motivation for this request onto the underlying socket.
157 void SetSocketMotivation(); 164 void SetSocketMotivation();
158 165
159 bool IsHttpsProxyAndHttpUrl(); 166 bool IsHttpsProxyAndHttpUrl();
160 167
161 // Sets several fields of ssl_config for the given origin_server based on the 168 // Sets several fields of ssl_config for the given origin_server based on the
162 // proxy info and other factors. 169 // proxy info and other factors.
163 void InitSSLConfig(const HostPortPair& origin_server, 170 void InitSSLConfig(const HostPortPair& origin_server,
164 SSLConfig* ssl_config) const; 171 SSLConfig* ssl_config) const;
165 172
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 255
249 // Force spdy only for SSL connections. 256 // Force spdy only for SSL connections.
250 bool force_spdy_over_ssl_; 257 bool force_spdy_over_ssl_;
251 258
252 // The certificate error while using SPDY over SSL for insecure URLs. 259 // The certificate error while using SPDY over SSL for insecure URLs.
253 int spdy_certificate_error_; 260 int spdy_certificate_error_;
254 261
255 scoped_refptr<HttpAuthController> 262 scoped_refptr<HttpAuthController>
256 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS]; 263 auth_controllers_[HttpAuth::AUTH_NUM_TARGETS];
257 264
265 // Invoked after a request for tunnel auth has been handled.
266 CompletionCallback tunnel_auth_handled_callback_;
267
258 // True when the tunnel is in the process of being established - we can't 268 // True when the tunnel is in the process of being established - we can't
259 // read from the socket until the tunnel is done. 269 // read from the socket until the tunnel is done.
260 bool establishing_tunnel_; 270 bool establishing_tunnel_;
261 271
262 scoped_ptr<HttpStream> stream_; 272 scoped_ptr<HttpStream> stream_;
263 273
264 // True if we negotiated NPN. 274 // True if we negotiated NPN.
265 bool was_npn_negotiated_; 275 bool was_npn_negotiated_;
266 276
267 // Protocol negotiated with the server. 277 // Protocol negotiated with the server.
(...skipping 16 matching lines...) Expand all
284 bool existing_available_pipeline_; 294 bool existing_available_pipeline_;
285 295
286 base::WeakPtrFactory<Job> ptr_factory_; 296 base::WeakPtrFactory<Job> ptr_factory_;
287 297
288 DISALLOW_COPY_AND_ASSIGN(Job); 298 DISALLOW_COPY_AND_ASSIGN(Job);
289 }; 299 };
290 300
291 } // namespace net 301 } // namespace net
292 302
293 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_ 303 #endif // NET_HTTP_HTTP_STREAM_FACTORY_IMPL_JOB_H_
OLDNEW
« no previous file with comments | « net/http/http_proxy_utils.cc ('k') | net/http/http_stream_factory_impl_job.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698