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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/string16.h" | |
10 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
11 #include "net/base/load_states.h" | 10 #include "net/base/load_states.h" |
12 #include "net/base/net_export.h" | 11 #include "net/base/net_export.h" |
13 | 12 |
14 namespace net { | 13 namespace net { |
15 | 14 |
| 15 class AuthCredentials; |
16 class BoundNetLog; | 16 class BoundNetLog; |
17 struct HttpRequestInfo; | 17 struct HttpRequestInfo; |
18 class HttpResponseInfo; | 18 class HttpResponseInfo; |
19 class IOBuffer; | 19 class IOBuffer; |
20 class X509Certificate; | 20 class X509Certificate; |
21 class SSLHostInfo; | 21 class SSLHostInfo; |
22 | 22 |
23 // Represents a single HTTP transaction (i.e., a single request/response pair). | 23 // Represents a single HTTP transaction (i.e., a single request/response pair). |
24 // HTTP redirects are not followed and authentication challenges are not | 24 // HTTP redirects are not followed and authentication challenges are not |
25 // answered. Cookies are assumed to be managed by the caller. | 25 // answered. Cookies are assumed to be managed by the caller. |
(...skipping 30 matching lines...) Expand all Loading... |
56 // | 56 // |
57 // NOTE: The transaction is not responsible for deleting the callback object. | 57 // NOTE: The transaction is not responsible for deleting the callback object. |
58 // | 58 // |
59 virtual int RestartIgnoringLastError(OldCompletionCallback* callback) = 0; | 59 virtual int RestartIgnoringLastError(OldCompletionCallback* callback) = 0; |
60 | 60 |
61 // Restarts the HTTP transaction with a client certificate. | 61 // Restarts the HTTP transaction with a client certificate. |
62 virtual int RestartWithCertificate(X509Certificate* client_cert, | 62 virtual int RestartWithCertificate(X509Certificate* client_cert, |
63 OldCompletionCallback* callback) = 0; | 63 OldCompletionCallback* callback) = 0; |
64 | 64 |
65 // Restarts the HTTP transaction with authentication credentials. | 65 // Restarts the HTTP transaction with authentication credentials. |
66 virtual int RestartWithAuth(const string16& username, | 66 virtual int RestartWithAuth(const AuthCredentials& credentials, |
67 const string16& password, | |
68 OldCompletionCallback* callback) = 0; | 67 OldCompletionCallback* callback) = 0; |
69 | 68 |
70 // Returns true if auth is ready to be continued. Callers should check | 69 // Returns true if auth is ready to be continued. Callers should check |
71 // this value anytime Start() completes: if it is true, the transaction | 70 // this value anytime Start() completes: if it is true, the transaction |
72 // can be resumed with RestartWithAuth(L"", L"", callback) to resume | 71 // can be resumed with RestartWithAuth(L"", L"", callback) to resume |
73 // the automatic auth exchange. This notification gives the caller a | 72 // the automatic auth exchange. This notification gives the caller a |
74 // chance to process the response headers from all of the intermediate | 73 // chance to process the response headers from all of the intermediate |
75 // restarts needed for authentication. | 74 // restarts needed for authentication. |
76 virtual bool IsReadyToRestartForAuth() = 0; | 75 virtual bool IsReadyToRestartForAuth() = 0; |
77 | 76 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 | 114 |
116 // SetSSLHostInfo sets a object which reads and writes public information | 115 // SetSSLHostInfo sets a object which reads and writes public information |
117 // about an SSL server. It's used to implement Snap Start. | 116 // about an SSL server. It's used to implement Snap Start. |
118 // TODO(agl): remove this. | 117 // TODO(agl): remove this. |
119 virtual void SetSSLHostInfo(SSLHostInfo*) { }; | 118 virtual void SetSSLHostInfo(SSLHostInfo*) { }; |
120 }; | 119 }; |
121 | 120 |
122 } // namespace net | 121 } // namespace net |
123 | 122 |
124 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 123 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |