| 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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 void OnBeforeSendProxyHeaders(URLRequest* request, | 82 void OnBeforeSendProxyHeaders(URLRequest* request, |
| 83 const ProxyInfo& proxy_info, | 83 const ProxyInfo& proxy_info, |
| 84 HttpRequestHeaders* headers) override; | 84 HttpRequestHeaders* headers) override; |
| 85 | 85 |
| 86 // Called right before the HTTP request(s) are being sent to the network. | 86 // Called right before the HTTP request(s) are being sent to the network. |
| 87 // |headers| is only valid until OnCompleted or OnURLRequestDestroyed is | 87 // |headers| is only valid until OnCompleted or OnURLRequestDestroyed is |
| 88 // called for this request. | 88 // called for this request. |
| 89 void OnSendHeaders(URLRequest* request, | 89 void OnSendHeaders(URLRequest* request, |
| 90 const HttpRequestHeaders& headers) override; | 90 const HttpRequestHeaders& headers) override; |
| 91 | 91 |
| 92 // Called when bytes are sent over the network, such as when sending request |
| 93 // headers or uploading request body bytes. This includes localhost requests. |
| 94 // |bytes_sent| is the number of bytes measured at the application layer that |
| 95 // have been sent over the network for this request since the last time |
| 96 // OnNetworkBytesSent was called. |bytes_sent| will always be greater than 0. |
| 97 // Currently, this is only implemented for HTTP transactions, and |bytes_sent| |
| 98 // does not include TLS overhead or TCP retransmits. |
| 99 void OnNetworkBytesSent(const URLRequest& request, |
| 100 int64_t bytes_sent) override; |
| 101 |
| 92 // Called for HTTP requests when the headers have been received. | 102 // Called for HTTP requests when the headers have been received. |
| 93 // |original_response_headers| contains the headers as received over the | 103 // |original_response_headers| contains the headers as received over the |
| 94 // network, these must not be modified. |override_response_headers| can be set | 104 // network, these must not be modified. |override_response_headers| can be set |
| 95 // to new values, that should be considered as overriding | 105 // to new values, that should be considered as overriding |
| 96 // |original_response_headers|. | 106 // |original_response_headers|. |
| 97 // If the response is a redirect, and the Location response header value is | 107 // If the response is a redirect, and the Location response header value is |
| 98 // identical to |allowed_unsafe_redirect_url|, then the redirect is never | 108 // identical to |allowed_unsafe_redirect_url|, then the redirect is never |
| 99 // blocked and the reference fragment is not copied from the original URL | 109 // blocked and the reference fragment is not copied from the original URL |
| 100 // to the redirection target. | 110 // to the redirection target. |
| 101 // | 111 // |
| (...skipping 108 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 |