| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "net/base/completion_callback.h" | 8 #include "net/base/completion_callback.h" |
| 9 #include "net/base/load_states.h" | 9 #include "net/base/load_states.h" |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // | 48 // |
| 49 // NOTE: The transaction is not responsible for deleting the callback object. | 49 // NOTE: The transaction is not responsible for deleting the callback object. |
| 50 // | 50 // |
| 51 virtual int RestartIgnoringLastError(CompletionCallback* callback) = 0; | 51 virtual int RestartIgnoringLastError(CompletionCallback* callback) = 0; |
| 52 | 52 |
| 53 // Restarts the HTTP transaction with authentication credentials. | 53 // Restarts the HTTP transaction with authentication credentials. |
| 54 virtual int RestartWithAuth(const std::wstring& username, | 54 virtual int RestartWithAuth(const std::wstring& username, |
| 55 const std::wstring& password, | 55 const std::wstring& password, |
| 56 CompletionCallback* callback) = 0; | 56 CompletionCallback* callback) = 0; |
| 57 | 57 |
| 58 // Returns true if auth is ready to be continued. Callers should check |
| 59 // this value anytime Start() completes: if it is true, the transaction |
| 60 // can be resumed with RestartWithAuth(L"", L"", callback) to resume |
| 61 // the automatic auth exchange. This notification gives the caller a |
| 62 // chance to process the response headers from all of the intermediate |
| 63 // restarts needed for authentication. |
| 64 virtual bool IsReadyToRestartForAuth() = 0; |
| 65 |
| 58 // Once response info is available for the transaction, response data may be | 66 // Once response info is available for the transaction, response data may be |
| 59 // read by calling this method. | 67 // read by calling this method. |
| 60 // | 68 // |
| 61 // Response data is copied into the given buffer and the number of bytes | 69 // Response data is copied into the given buffer and the number of bytes |
| 62 // copied is returned. ERR_IO_PENDING is returned if response data is not | 70 // copied is returned. ERR_IO_PENDING is returned if response data is not |
| 63 // yet available. The CompletionCallback is notified when the data copy | 71 // yet available. The CompletionCallback is notified when the data copy |
| 64 // completes, and it is passed the number of bytes that were successfully | 72 // completes, and it is passed the number of bytes that were successfully |
| 65 // copied. Or, if a read error occurs, the CompletionCallback is notified of | 73 // copied. Or, if a read error occurs, the CompletionCallback is notified of |
| 66 // the error. Any other negative return value indicates that the transaction | 74 // the error. Any other negative return value indicates that the transaction |
| 67 // could not be read. | 75 // could not be read. |
| (...skipping 13 matching lines...) Expand all Loading... |
| 81 virtual LoadState GetLoadState() const = 0; | 89 virtual LoadState GetLoadState() const = 0; |
| 82 | 90 |
| 83 // Returns the upload progress in bytes. If there is no upload data, | 91 // Returns the upload progress in bytes. If there is no upload data, |
| 84 // zero will be returned. This does not include the request headers. | 92 // zero will be returned. This does not include the request headers. |
| 85 virtual uint64 GetUploadProgress() const = 0; | 93 virtual uint64 GetUploadProgress() const = 0; |
| 86 }; | 94 }; |
| 87 | 95 |
| 88 } // namespace net | 96 } // namespace net |
| 89 | 97 |
| 90 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 98 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
| OLD | NEW |