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 "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 #include "net/base/net_export.h" | 10 #include "net/base/net_export.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 // yet available. The CompletionCallback is notified when the data copy | 90 // yet available. The CompletionCallback is notified when the data copy |
91 // completes, and it is passed the number of bytes that were successfully | 91 // completes, and it is passed the number of bytes that were successfully |
92 // copied. Or, if a read error occurs, the CompletionCallback is notified of | 92 // copied. Or, if a read error occurs, the CompletionCallback is notified of |
93 // the error. Any other negative return value indicates that the transaction | 93 // the error. Any other negative return value indicates that the transaction |
94 // could not be read. | 94 // could not be read. |
95 // | 95 // |
96 // NOTE: The transaction is not responsible for deleting the callback object. | 96 // NOTE: The transaction is not responsible for deleting the callback object. |
97 // If the operation is not completed immediately, the transaction must acquire | 97 // If the operation is not completed immediately, the transaction must acquire |
98 // a reference to the provided buffer. | 98 // a reference to the provided buffer. |
99 // | 99 // |
100 virtual int Read(IOBuffer* buf, int buf_len, | 100 virtual int Read(IOBuffer* buf, |
| 101 int buf_len, |
101 const CompletionCallback& callback) = 0; | 102 const CompletionCallback& callback) = 0; |
102 | 103 |
103 // Stops further caching of this request by the HTTP cache, if there is any. | 104 // Stops further caching of this request by the HTTP cache, if there is any. |
104 virtual void StopCaching() = 0; | 105 virtual void StopCaching() = 0; |
105 | 106 |
106 // Gets the full request headers sent to the server. This is guaranteed to | 107 // Gets the full request headers sent to the server. This is guaranteed to |
107 // work only if Start returns success and the underlying transaction supports | 108 // work only if Start returns success and the underlying transaction supports |
108 // it. (Right now, this is only network transactions, not cache ones.) | 109 // it. (Right now, this is only network transactions, not cache ones.) |
109 // | 110 // |
110 // Returns true and overwrites headers if it can get the request headers; | 111 // Returns true and overwrites headers if it can get the request headers; |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
158 virtual void SetBeforeNetworkStartCallback( | 159 virtual void SetBeforeNetworkStartCallback( |
159 const BeforeNetworkStartCallback& callback) = 0; | 160 const BeforeNetworkStartCallback& callback) = 0; |
160 | 161 |
161 // Resumes the transaction after being deferred. | 162 // Resumes the transaction after being deferred. |
162 virtual int ResumeNetworkStart() = 0; | 163 virtual int ResumeNetworkStart() = 0; |
163 }; | 164 }; |
164 | 165 |
165 } // namespace net | 166 } // namespace net |
166 | 167 |
167 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 168 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |