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_TRANSACTION_H_ | 5 #ifndef NET_HTTP_HTTP_TRANSACTION_H_ |
6 #define NET_HTTP_HTTP_TRANSACTION_H_ | 6 #define NET_HTTP_HTTP_TRANSACTION_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
11 #include "net/base/load_states.h" | 11 #include "net/base/load_states.h" |
12 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
13 #include "net/base/request_priority.h" | 13 #include "net/base/request_priority.h" |
14 #include "net/base/upload_progress.h" | 14 #include "net/base/upload_progress.h" |
15 #include "net/socket/connection_attempts.h" | 15 #include "net/socket/connection_attempts.h" |
16 #include "net/websockets/websocket_handshake_stream_base.h" | 16 #include "net/websockets/websocket_handshake_stream_base.h" |
17 | 17 |
18 namespace net { | 18 namespace net { |
19 | 19 |
20 class AuthCredentials; | 20 class AuthCredentials; |
21 class BoundNetLog; | 21 class BoundNetLog; |
22 class HttpRequestHeaders; | 22 class HttpRequestHeaders; |
23 struct HttpRequestInfo; | 23 struct HttpRequestInfo; |
24 class HttpResponseInfo; | 24 class HttpResponseInfo; |
25 class IOBuffer; | 25 class IOBuffer; |
26 struct LoadTimingInfo; | 26 struct LoadTimingInfo; |
27 class ProxyInfo; | 27 class ProxyInfo; |
28 class QuicServerInfo; | 28 class QuicServerInfo; |
| 29 class SSLPrivateKey; |
29 class X509Certificate; | 30 class X509Certificate; |
30 | 31 |
31 // Represents a single HTTP transaction (i.e., a single request/response pair). | 32 // Represents a single HTTP transaction (i.e., a single request/response pair). |
32 // HTTP redirects are not followed and authentication challenges are not | 33 // HTTP redirects are not followed and authentication challenges are not |
33 // answered. Cookies are assumed to be managed by the caller. | 34 // answered. Cookies are assumed to be managed by the caller. |
34 class NET_EXPORT_PRIVATE HttpTransaction { | 35 class NET_EXPORT_PRIVATE HttpTransaction { |
35 public: | 36 public: |
36 // If |*defer| is set to true, the transaction will wait until | 37 // If |*defer| is set to true, the transaction will wait until |
37 // ResumeNetworkStart is called before establishing a connection. | 38 // ResumeNetworkStart is called before establishing a connection. |
38 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; | 39 typedef base::Callback<void(bool* defer)> BeforeNetworkStartCallback; |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 // | 74 // |
74 // Not all errors can be ignored using this method. See error code | 75 // Not all errors can be ignored using this method. See error code |
75 // descriptions for details about errors that can be ignored. | 76 // descriptions for details about errors that can be ignored. |
76 // | 77 // |
77 // NOTE: The transaction is not responsible for deleting the callback object. | 78 // NOTE: The transaction is not responsible for deleting the callback object. |
78 // | 79 // |
79 virtual int RestartIgnoringLastError(const CompletionCallback& callback) = 0; | 80 virtual int RestartIgnoringLastError(const CompletionCallback& callback) = 0; |
80 | 81 |
81 // Restarts the HTTP transaction with a client certificate. | 82 // Restarts the HTTP transaction with a client certificate. |
82 virtual int RestartWithCertificate(X509Certificate* client_cert, | 83 virtual int RestartWithCertificate(X509Certificate* client_cert, |
| 84 SSLPrivateKey* client_private_key, |
83 const CompletionCallback& callback) = 0; | 85 const CompletionCallback& callback) = 0; |
84 | 86 |
85 // Restarts the HTTP transaction with authentication credentials. | 87 // Restarts the HTTP transaction with authentication credentials. |
86 virtual int RestartWithAuth(const AuthCredentials& credentials, | 88 virtual int RestartWithAuth(const AuthCredentials& credentials, |
87 const CompletionCallback& callback) = 0; | 89 const CompletionCallback& callback) = 0; |
88 | 90 |
89 // Returns true if auth is ready to be continued. Callers should check | 91 // Returns true if auth is ready to be continued. Callers should check |
90 // this value anytime Start() completes: if it is true, the transaction | 92 // this value anytime Start() completes: if it is true, the transaction |
91 // can be resumed with RestartWithAuth(L"", L"", callback) to resume | 93 // can be resumed with RestartWithAuth(L"", L"", callback) to resume |
92 // the automatic auth exchange. This notification gives the caller a | 94 // the automatic auth exchange. This notification gives the caller a |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 | 188 |
187 // Resumes the transaction after being deferred. | 189 // Resumes the transaction after being deferred. |
188 virtual int ResumeNetworkStart() = 0; | 190 virtual int ResumeNetworkStart() = 0; |
189 | 191 |
190 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; | 192 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; |
191 }; | 193 }; |
192 | 194 |
193 } // namespace net | 195 } // namespace net |
194 | 196 |
195 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 197 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |