| 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 "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "net/base/completion_callback.h" | 9 #include "net/base/completion_callback.h" |
| 10 #include "net/base/network_delegate.h" | 10 #include "net/base/network_delegate.h" |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 // |new_location| is only valid until OnURLRequestDestroyed is called for this | 111 // |new_location| is only valid until OnURLRequestDestroyed is called for this |
| 112 // request. | 112 // request. |
| 113 void OnBeforeRedirect(URLRequest* request, const GURL& new_location) override; | 113 void OnBeforeRedirect(URLRequest* request, const GURL& new_location) override; |
| 114 | 114 |
| 115 // This corresponds to URLRequestDelegate::OnResponseStarted. | 115 // This corresponds to URLRequestDelegate::OnResponseStarted. |
| 116 void OnResponseStarted(URLRequest* request) override; | 116 void OnResponseStarted(URLRequest* request) override; |
| 117 | 117 |
| 118 // Called every time we read raw bytes. | 118 // Called every time we read raw bytes. |
| 119 void OnRawBytesRead(const URLRequest& request, int bytes_read) override; | 119 void OnRawBytesRead(const URLRequest& request, int bytes_read) override; |
| 120 | 120 |
| 121 // Called when bytes are received from the network, such as after receiving |
| 122 // headers or reading raw response bytes. |bytes_received| is the number of |
| 123 // bytes measured at the application layer that have been received over the |
| 124 // network since the last time OnNetworkBytesReceived was called. |
| 125 // |bytes_received| will always be greater than 0. |
| 126 void OnNetworkBytesReceived(const URLRequest& request, |
| 127 int64 bytes_received) override; |
| 128 |
| 121 // Indicates that the URL request has been completed or failed. | 129 // Indicates that the URL request has been completed or failed. |
| 122 // |started| indicates whether the request has been started. If false, | 130 // |started| indicates whether the request has been started. If false, |
| 123 // some information like the socket address is not available. | 131 // some information like the socket address is not available. |
| 124 void OnCompleted(URLRequest* request, bool started) override; | 132 void OnCompleted(URLRequest* request, bool started) override; |
| 125 | 133 |
| 126 // Called when an URLRequest is being destroyed. Note that the request is | 134 // Called when an URLRequest is being destroyed. Note that the request is |
| 127 // being deleted, so it's not safe to call any methods that may result in | 135 // being deleted, so it's not safe to call any methods that may result in |
| 128 // a virtual method call. | 136 // a virtual method call. |
| 129 void OnURLRequestDestroyed(URLRequest* request) override; | 137 void OnURLRequestDestroyed(URLRequest* request) override; |
| 130 | 138 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 193 // header is stripped from the request. | 201 // header is stripped from the request. |
| 194 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 202 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 195 const URLRequest& request, | 203 const URLRequest& request, |
| 196 const GURL& target_url, | 204 const GURL& target_url, |
| 197 const GURL& referrer_url) const override; | 205 const GURL& referrer_url) const override; |
| 198 }; | 206 }; |
| 199 | 207 |
| 200 } // namespace net | 208 } // namespace net |
| 201 | 209 |
| 202 #endif // NET_BASE_NETWORK_DELEGATE_IMPL_H_ | 210 #endif // NET_BASE_NETWORK_DELEGATE_IMPL_H_ |
| OLD | NEW |