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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // it. (Right now, this is only network transactions, not cache ones.) | 102 // it. (Right now, this is only network transactions, not cache ones.) |
103 // | 103 // |
104 // Returns true and overwrites headers if it can get the request headers; | 104 // Returns true and overwrites headers if it can get the request headers; |
105 // otherwise, returns false and does not modify headers. | 105 // otherwise, returns false and does not modify headers. |
106 virtual bool GetFullRequestHeaders(HttpRequestHeaders* headers) const = 0; | 106 virtual bool GetFullRequestHeaders(HttpRequestHeaders* headers) const = 0; |
107 | 107 |
108 // Called to tell the transaction that we have successfully reached the end | 108 // Called to tell the transaction that we have successfully reached the end |
109 // of the stream. This is equivalent to performing an extra Read() at the end | 109 // of the stream. This is equivalent to performing an extra Read() at the end |
110 // that should return 0 bytes. This method should not be called if the | 110 // that should return 0 bytes. This method should not be called if the |
111 // transaction is busy processing a previous operation (like a pending Read). | 111 // transaction is busy processing a previous operation (like a pending Read). |
| 112 // |
| 113 // DoneReading may also be called before the first Read() to notify that the |
| 114 // entire response body is to be ignored (e.g., in a redirect). |
112 virtual void DoneReading() = 0; | 115 virtual void DoneReading() = 0; |
113 | 116 |
114 // Returns the response info for this transaction or NULL if the response | 117 // Returns the response info for this transaction or NULL if the response |
115 // info is not available. | 118 // info is not available. |
116 virtual const HttpResponseInfo* GetResponseInfo() const = 0; | 119 virtual const HttpResponseInfo* GetResponseInfo() const = 0; |
117 | 120 |
118 // Returns the load state for this transaction. | 121 // Returns the load state for this transaction. |
119 virtual LoadState GetLoadState() const = 0; | 122 virtual LoadState GetLoadState() const = 0; |
120 | 123 |
121 // Returns the upload progress in bytes. If there is no upload data, | 124 // Returns the upload progress in bytes. If there is no upload data, |
122 // zero will be returned. This does not include the request headers. | 125 // zero will be returned. This does not include the request headers. |
123 virtual UploadProgress GetUploadProgress() const = 0; | 126 virtual UploadProgress GetUploadProgress() const = 0; |
124 | 127 |
125 // Populates all of load timing, except for request start times and receive | 128 // Populates all of load timing, except for request start times and receive |
126 // headers time. | 129 // headers time. |
127 // |load_timing_info| must have all null times when called. Returns false and | 130 // |load_timing_info| must have all null times when called. Returns false and |
128 // does not modify |load_timing_info| if there's no timing information to | 131 // does not modify |load_timing_info| if there's no timing information to |
129 // provide. | 132 // provide. |
130 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; | 133 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; |
131 | 134 |
132 // Called when the priority of the parent job changes. | 135 // Called when the priority of the parent job changes. |
133 virtual void SetPriority(RequestPriority priority) = 0; | 136 virtual void SetPriority(RequestPriority priority) = 0; |
134 }; | 137 }; |
135 | 138 |
136 } // namespace net | 139 } // namespace net |
137 | 140 |
138 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 141 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |