OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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_NETWORK_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
11 #include "base/scoped_ptr.h" | 11 #include "base/scoped_ptr.h" |
(...skipping 25 matching lines...) Expand all Loading... |
37 public: | 37 public: |
38 HttpNetworkTransaction(HttpNetworkSession* session, | 38 HttpNetworkTransaction(HttpNetworkSession* session, |
39 ClientSocketFactory* socket_factory); | 39 ClientSocketFactory* socket_factory); |
40 | 40 |
41 virtual ~HttpNetworkTransaction(); | 41 virtual ~HttpNetworkTransaction(); |
42 | 42 |
43 // HttpTransaction methods: | 43 // HttpTransaction methods: |
44 virtual int Start(const HttpRequestInfo* request_info, | 44 virtual int Start(const HttpRequestInfo* request_info, |
45 CompletionCallback* callback); | 45 CompletionCallback* callback); |
46 virtual int RestartIgnoringLastError(CompletionCallback* callback); | 46 virtual int RestartIgnoringLastError(CompletionCallback* callback); |
| 47 virtual int RestartWithCertificate(X509Certificate* client_cert, |
| 48 CompletionCallback* callback); |
47 virtual int RestartWithAuth(const std::wstring& username, | 49 virtual int RestartWithAuth(const std::wstring& username, |
48 const std::wstring& password, | 50 const std::wstring& password, |
49 CompletionCallback* callback); | 51 CompletionCallback* callback); |
50 virtual bool IsReadyToRestartForAuth() { | 52 virtual bool IsReadyToRestartForAuth() { |
51 return pending_auth_target_ != HttpAuth::AUTH_NONE && | 53 return pending_auth_target_ != HttpAuth::AUTH_NONE && |
52 HaveAuth(pending_auth_target_); | 54 HaveAuth(pending_auth_target_); |
53 } | 55 } |
54 | 56 |
55 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); | 57 virtual int Read(IOBuffer* buf, int buf_len, CompletionCallback* callback); |
56 virtual const HttpResponseInfo* GetResponseInfo() const; | 58 virtual const HttpResponseInfo* GetResponseInfo() const; |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 void LogBlockedTunnelResponse(int response_code) const; | 155 void LogBlockedTunnelResponse(int response_code) const; |
154 | 156 |
155 // Called when header_buf_ contains the complete response headers. | 157 // Called when header_buf_ contains the complete response headers. |
156 int DidReadResponseHeaders(); | 158 int DidReadResponseHeaders(); |
157 | 159 |
158 // Called to handle a certificate error. Returns OK if the error should be | 160 // Called to handle a certificate error. Returns OK if the error should be |
159 // ignored. Otherwise, stores the certificate in response_.ssl_info and | 161 // ignored. Otherwise, stores the certificate in response_.ssl_info and |
160 // returns the same error code. | 162 // returns the same error code. |
161 int HandleCertificateError(int error); | 163 int HandleCertificateError(int error); |
162 | 164 |
| 165 // Called to handle a client certificate request. |
| 166 void HandleCertificateRequest(); |
| 167 |
163 // Called to possibly recover from an SSL handshake error. Sets next_state_ | 168 // Called to possibly recover from an SSL handshake error. Sets next_state_ |
164 // and returns OK if recovering from the error. Otherwise, the same error | 169 // and returns OK if recovering from the error. Otherwise, the same error |
165 // code is returned. | 170 // code is returned. |
166 int HandleSSLHandshakeError(int error); | 171 int HandleSSLHandshakeError(int error); |
167 | 172 |
168 // Called to possibly recover from the given error. Sets next_state_ and | 173 // Called to possibly recover from the given error. Sets next_state_ and |
169 // returns OK if recovering from the error. Otherwise, the same error code | 174 // returns OK if recovering from the error. Otherwise, the same error code |
170 // is returned. | 175 // is returned. |
171 int HandleIOError(int error); | 176 int HandleIOError(int error); |
172 | 177 |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 // The time the host resolution started (if it indeed got started). | 386 // The time the host resolution started (if it indeed got started). |
382 base::Time host_resolution_start_time_; | 387 base::Time host_resolution_start_time_; |
383 | 388 |
384 // The next state in the state machine. | 389 // The next state in the state machine. |
385 State next_state_; | 390 State next_state_; |
386 }; | 391 }; |
387 | 392 |
388 } // namespace net | 393 } // namespace net |
389 | 394 |
390 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ | 395 #endif // NET_HTTP_HTTP_NETWORK_TRANSACTION_H_ |
OLD | NEW |