| 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 // This is used to inform the cache that the response was not canceled |
| 113 // prematurely. |
| 114 // |
| 115 // DoneReading may also be called before the first Read() to notify that the |
| 116 // entire response body is to be ignored (e.g., in a redirect). |
| 112 virtual void DoneReading() = 0; | 117 virtual void DoneReading() = 0; |
| 113 | 118 |
| 114 // Returns the response info for this transaction or NULL if the response | 119 // Returns the response info for this transaction or NULL if the response |
| 115 // info is not available. | 120 // info is not available. |
| 116 virtual const HttpResponseInfo* GetResponseInfo() const = 0; | 121 virtual const HttpResponseInfo* GetResponseInfo() const = 0; |
| 117 | 122 |
| 118 // Returns the load state for this transaction. | 123 // Returns the load state for this transaction. |
| 119 virtual LoadState GetLoadState() const = 0; | 124 virtual LoadState GetLoadState() const = 0; |
| 120 | 125 |
| 121 // Returns the upload progress in bytes. If there is no upload data, | 126 // Returns the upload progress in bytes. If there is no upload data, |
| 122 // zero will be returned. This does not include the request headers. | 127 // zero will be returned. This does not include the request headers. |
| 123 virtual UploadProgress GetUploadProgress() const = 0; | 128 virtual UploadProgress GetUploadProgress() const = 0; |
| 124 | 129 |
| 125 // Populates all of load timing, except for request start times and receive | 130 // Populates all of load timing, except for request start times and receive |
| 126 // headers time. | 131 // headers time. |
| 127 // |load_timing_info| must have all null times when called. Returns false and | 132 // |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 | 133 // does not modify |load_timing_info| if there's no timing information to |
| 129 // provide. | 134 // provide. |
| 130 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; | 135 virtual bool GetLoadTimingInfo(LoadTimingInfo* load_timing_info) const = 0; |
| 131 | 136 |
| 132 // Called when the priority of the parent job changes. | 137 // Called when the priority of the parent job changes. |
| 133 virtual void SetPriority(RequestPriority priority) = 0; | 138 virtual void SetPriority(RequestPriority priority) = 0; |
| 134 }; | 139 }; |
| 135 | 140 |
| 136 } // namespace net | 141 } // namespace net |
| 137 | 142 |
| 138 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 143 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
| OLD | NEW |