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 <stdint.h> |
| 9 |
8 #include "net/base/completion_callback.h" | 10 #include "net/base/completion_callback.h" |
9 #include "net/base/load_states.h" | 11 #include "net/base/load_states.h" |
10 #include "net/base/net_export.h" | 12 #include "net/base/net_export.h" |
11 #include "net/base/request_priority.h" | 13 #include "net/base/request_priority.h" |
12 #include "net/base/upload_progress.h" | 14 #include "net/base/upload_progress.h" |
13 #include "net/socket/connection_attempts.h" | 15 #include "net/socket/connection_attempts.h" |
14 #include "net/websockets/websocket_handshake_stream_base.h" | 16 #include "net/websockets/websocket_handshake_stream_base.h" |
15 | 17 |
16 namespace net { | 18 namespace net { |
17 | 19 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 // work only if Start returns success and the underlying transaction supports | 119 // work only if Start returns success and the underlying transaction supports |
118 // it. (Right now, this is only network transactions, not cache ones.) | 120 // it. (Right now, this is only network transactions, not cache ones.) |
119 // | 121 // |
120 // Returns true and overwrites headers if it can get the request headers; | 122 // Returns true and overwrites headers if it can get the request headers; |
121 // otherwise, returns false and does not modify headers. | 123 // otherwise, returns false and does not modify headers. |
122 virtual bool GetFullRequestHeaders(HttpRequestHeaders* headers) const = 0; | 124 virtual bool GetFullRequestHeaders(HttpRequestHeaders* headers) const = 0; |
123 | 125 |
124 // Get the number of bytes received from network. | 126 // Get the number of bytes received from network. |
125 virtual int64 GetTotalReceivedBytes() const = 0; | 127 virtual int64 GetTotalReceivedBytes() const = 0; |
126 | 128 |
| 129 // Get the number of bytes sent over the network. |
| 130 virtual int64_t GetTotalSentBytes() const = 0; |
| 131 |
127 // Called to tell the transaction that we have successfully reached the end | 132 // Called to tell the transaction that we have successfully reached the end |
128 // of the stream. This is equivalent to performing an extra Read() at the end | 133 // of the stream. This is equivalent to performing an extra Read() at the end |
129 // that should return 0 bytes. This method should not be called if the | 134 // that should return 0 bytes. This method should not be called if the |
130 // transaction is busy processing a previous operation (like a pending Read). | 135 // transaction is busy processing a previous operation (like a pending Read). |
131 // | 136 // |
132 // DoneReading may also be called before the first Read() to notify that the | 137 // DoneReading may also be called before the first Read() to notify that the |
133 // entire response body is to be ignored (e.g., in a redirect). | 138 // entire response body is to be ignored (e.g., in a redirect). |
134 virtual void DoneReading() = 0; | 139 virtual void DoneReading() = 0; |
135 | 140 |
136 // Returns the response info for this transaction. Must not be called until | 141 // Returns the response info for this transaction. Must not be called until |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 | 180 |
176 // Resumes the transaction after being deferred. | 181 // Resumes the transaction after being deferred. |
177 virtual int ResumeNetworkStart() = 0; | 182 virtual int ResumeNetworkStart() = 0; |
178 | 183 |
179 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; | 184 virtual void GetConnectionAttempts(ConnectionAttempts* out) const = 0; |
180 }; | 185 }; |
181 | 186 |
182 } // namespace net | 187 } // namespace net |
183 | 188 |
184 #endif // NET_HTTP_HTTP_TRANSACTION_H_ | 189 #endif // NET_HTTP_HTTP_TRANSACTION_H_ |
OLD | NEW |