| 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 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // | 59 // |
| 60 // Response data is copied into the given buffer and the number of bytes | 60 // Response data is copied into the given buffer and the number of bytes |
| 61 // copied is returned. ERR_IO_PENDING is returned if response data is not | 61 // copied is returned. ERR_IO_PENDING is returned if response data is not |
| 62 // yet available. The CompletionCallback is notified when the data copy | 62 // yet available. The CompletionCallback is notified when the data copy |
| 63 // completes, and it is passed the number of bytes that were successfully | 63 // completes, and it is passed the number of bytes that were successfully |
| 64 // copied. Or, if a read error occurs, the CompletionCallback is notified of | 64 // copied. Or, if a read error occurs, the CompletionCallback is notified of |
| 65 // the error. Any other negative return value indicates that the transaction | 65 // the error. Any other negative return value indicates that the transaction |
| 66 // could not be read. | 66 // could not be read. |
| 67 // | 67 // |
| 68 // NOTE: The transaction is not responsible for deleting the callback object. | 68 // NOTE: The transaction is not responsible for deleting the callback object. |
| 69 // If the operation is not completed immediately, the transaction must acquire |
| 70 // a reference to the provided buffer. |
| 69 // | 71 // |
| 70 virtual int Read(char* buf, int buf_len, CompletionCallback* callback) = 0; | 72 virtual int Read(IOBuffer* buf, int buf_len, |
| 73 CompletionCallback* callback) = 0; |
| 71 | 74 |
| 72 // Returns the response info for this transaction or NULL if the response | 75 // Returns the response info for this transaction or NULL if the response |
| 73 // info is not available. | 76 // info is not available. |
| 74 virtual const HttpResponseInfo* GetResponseInfo() const = 0; | 77 virtual const HttpResponseInfo* GetResponseInfo() const = 0; |
| 75 | 78 |
| 76 // Returns the load state for this transaction. | 79 // Returns the load state for this transaction. |
| 77 virtual LoadState GetLoadState() const = 0; | 80 virtual LoadState GetLoadState() const = 0; |
| 78 | 81 |
| 79 // Returns the upload progress in bytes. If there is no upload data, | 82 // Returns the upload progress in bytes. If there is no upload data, |
| 80 // zero will be returned. This does not include the request headers. | 83 // zero will be returned. This does not include the request headers. |
| 81 virtual uint64 GetUploadProgress() const = 0; | 84 virtual uint64 GetUploadProgress() const = 0; |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 } // namespace net | 87 } // namespace net |
| 85 | 88 |
| 86 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 89 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
| 87 | 90 |
| OLD | NEW |