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" | 9 #include "base/string16.h" |
10 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 // NOTE: The transaction is not responsible for deleting the callback object. | 89 // NOTE: The transaction is not responsible for deleting the callback object. |
90 // If the operation is not completed immediately, the transaction must acquire | 90 // If the operation is not completed immediately, the transaction must acquire |
91 // a reference to the provided buffer. | 91 // a reference to the provided buffer. |
92 // | 92 // |
93 virtual int Read(IOBuffer* buf, int buf_len, | 93 virtual int Read(IOBuffer* buf, int buf_len, |
94 CompletionCallback* callback) = 0; | 94 CompletionCallback* callback) = 0; |
95 | 95 |
96 // Stops further caching of this request by the HTTP cache, if there is any. | 96 // Stops further caching of this request by the HTTP cache, if there is any. |
97 virtual void StopCaching() = 0; | 97 virtual void StopCaching() = 0; |
98 | 98 |
| 99 // Called to tell the transaction that we have successfully reached the end |
| 100 // of the stream. This is equivalent to performing an extra Read() at the end |
| 101 // that should return 0 bytes. This method should not be called if the |
| 102 // transaction is busy processing a previous operation (like a pending Read). |
| 103 virtual void DoneReading() = 0; |
| 104 |
99 // Returns the response info for this transaction or NULL if the response | 105 // Returns the response info for this transaction or NULL if the response |
100 // info is not available. | 106 // info is not available. |
101 virtual const HttpResponseInfo* GetResponseInfo() const = 0; | 107 virtual const HttpResponseInfo* GetResponseInfo() const = 0; |
102 | 108 |
103 // Returns the load state for this transaction. | 109 // Returns the load state for this transaction. |
104 virtual LoadState GetLoadState() const = 0; | 110 virtual LoadState GetLoadState() const = 0; |
105 | 111 |
106 // Returns the upload progress in bytes. If there is no upload data, | 112 // Returns the upload progress in bytes. If there is no upload data, |
107 // zero will be returned. This does not include the request headers. | 113 // zero will be returned. This does not include the request headers. |
108 virtual uint64 GetUploadProgress() const = 0; | 114 virtual uint64 GetUploadProgress() const = 0; |
109 | 115 |
110 // SetSSLHostInfo sets a object which reads and writes public information | 116 // SetSSLHostInfo sets a object which reads and writes public information |
111 // about an SSL server. It's used to implement Snap Start. | 117 // about an SSL server. It's used to implement Snap Start. |
112 // TODO(agl): remove this. | 118 // TODO(agl): remove this. |
113 virtual void SetSSLHostInfo(SSLHostInfo*) { }; | 119 virtual void SetSSLHostInfo(SSLHostInfo*) { }; |
114 }; | 120 }; |
115 | 121 |
116 } // namespace net | 122 } // namespace net |
117 | 123 |
118 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 124 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |