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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 void OnResponseStarted(URLRequest* request) override; | 118 void OnResponseStarted(URLRequest* request) override; |
119 | 119 |
120 // Called when bytes are received from the network, such as after receiving | 120 // Called when bytes are received from the network, such as after receiving |
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(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 | 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. | 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 | 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 | 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. | 135 // OnNetworkBytesSent was called. |bytes_sent| will always be greater than 0. |
136 // Currently, this is only implemented for HTTP transactions, and |bytes_sent| | 136 // Currently, this is only implemented for HTTP transactions, and |bytes_sent| |
137 // does not include TLS overhead or TCP retransmits. | 137 // does not include TLS overhead or TCP retransmits. |
138 void OnNetworkBytesSent(const URLRequest& request, | 138 void OnNetworkBytesSent(URLRequest* request, int64_t bytes_sent) override; |
139 int64_t bytes_sent) override; | |
140 | 139 |
141 // Indicates that the URL request has been completed or failed. | 140 // Indicates that the URL request has been completed or failed. |
142 // |started| indicates whether the request has been started. If false, | 141 // |started| indicates whether the request has been started. If false, |
143 // some information like the socket address is not available. | 142 // some information like the socket address is not available. |
144 void OnCompleted(URLRequest* request, bool started) override; | 143 void OnCompleted(URLRequest* request, bool started) override; |
145 | 144 |
146 // Called when an URLRequest is being destroyed. Note that the request is | 145 // Called when an URLRequest is being destroyed. Note that the request is |
147 // being deleted, so it's not safe to call any methods that may result in | 146 // being deleted, so it's not safe to call any methods that may result in |
148 // a virtual method call. | 147 // a virtual method call. |
149 void OnURLRequestDestroyed(URLRequest* request) override; | 148 void OnURLRequestDestroyed(URLRequest* request) override; |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 // header is stripped from the request. | 220 // header is stripped from the request. |
222 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 221 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
223 const URLRequest& request, | 222 const URLRequest& request, |
224 const GURL& target_url, | 223 const GURL& target_url, |
225 const GURL& referrer_url) const override; | 224 const GURL& referrer_url) const override; |
226 }; | 225 }; |
227 | 226 |
228 } // namespace net | 227 } // namespace net |
229 | 228 |
230 #endif // NET_BASE_NETWORK_DELEGATE_IMPL_H_ | 229 #endif // NET_BASE_NETWORK_DELEGATE_IMPL_H_ |
OLD | NEW |