OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_BASE_NETWORK_DELEGATE_IMPL_H_ | 5 #ifndef NET_BASE_NETWORK_DELEGATE_IMPL_H_ |
6 #define NET_BASE_NETWORK_DELEGATE_IMPL_H_ | 6 #define NET_BASE_NETWORK_DELEGATE_IMPL_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 // headers or reading raw response bytes. This includes localhost requests. | 121 // headers or reading raw response bytes. This includes localhost requests. |
122 // |bytes_received| is the number of bytes measured at the application layer | 122 // |bytes_received| is the number of bytes measured at the application layer |
123 // that have been received over the network for this request since the last | 123 // that have been received over the network for this request since the last |
124 // time OnNetworkBytesReceived was called. |bytes_received| will always be | 124 // time OnNetworkBytesReceived was called. |bytes_received| will always be |
125 // greater than 0. | 125 // greater than 0. |
126 // Currently, this is only implemented for HTTP transactions, and | 126 // Currently, this is only implemented for HTTP transactions, and |
127 // |bytes_received| does not include TLS overhead or TCP retransmits. | 127 // |bytes_received| does not include TLS overhead or TCP retransmits. |
128 void OnNetworkBytesReceived(const URLRequest& request, | 128 void OnNetworkBytesReceived(const URLRequest& request, |
129 int64_t bytes_received) override; | 129 int64_t bytes_received) override; |
130 | 130 |
| 131 // Called when bytes are sent over the network, such as when sending request |
| 132 // headers or uploading request body bytes. This includes localhost requests. |
| 133 // |bytes_sent| is the number of bytes measured at the application layer that |
| 134 // have been sent over the network for this request since the last time |
| 135 // OnNetworkBytesSent was called. |bytes_sent| will always be greater than 0. |
| 136 // Currently, this is only implemented for HTTP transactions, and |bytes_sent| |
| 137 // does not include TLS overhead or TCP retransmits. |
| 138 void OnNetworkBytesSent(const URLRequest& request, |
| 139 int64_t bytes_sent) override; |
| 140 |
131 // Indicates that the URL request has been completed or failed. | 141 // Indicates that the URL request has been completed or failed. |
132 // |started| indicates whether the request has been started. If false, | 142 // |started| indicates whether the request has been started. If false, |
133 // some information like the socket address is not available. | 143 // some information like the socket address is not available. |
134 void OnCompleted(URLRequest* request, bool started) override; | 144 void OnCompleted(URLRequest* request, bool started) override; |
135 | 145 |
136 // Called when an URLRequest is being destroyed. Note that the request is | 146 // Called when an URLRequest is being destroyed. Note that the request is |
137 // being deleted, so it's not safe to call any methods that may result in | 147 // being deleted, so it's not safe to call any methods that may result in |
138 // a virtual method call. | 148 // a virtual method call. |
139 void OnURLRequestDestroyed(URLRequest* request) override; | 149 void OnURLRequestDestroyed(URLRequest* request) override; |
140 | 150 |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 // header is stripped from the request. | 220 // header is stripped from the request. |
211 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 221 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
212 const URLRequest& request, | 222 const URLRequest& request, |
213 const GURL& target_url, | 223 const GURL& target_url, |
214 const GURL& referrer_url) const override; | 224 const GURL& referrer_url) const override; |
215 }; | 225 }; |
216 | 226 |
217 } // namespace net | 227 } // namespace net |
218 | 228 |
219 #endif // NET_BASE_NETWORK_DELEGATE_IMPL_H_ | 229 #endif // NET_BASE_NETWORK_DELEGATE_IMPL_H_ |
OLD | NEW |