| 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> | 
|  | 9 | 
| 8 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" | 
| 9 #include "net/base/completion_callback.h" | 11 #include "net/base/completion_callback.h" | 
| 10 #include "net/base/network_delegate.h" | 12 #include "net/base/network_delegate.h" | 
| 11 #include "net/cookies/canonical_cookie.h" | 13 #include "net/cookies/canonical_cookie.h" | 
| 12 | 14 | 
| 13 class GURL; | 15 class GURL; | 
| 14 | 16 | 
| 15 namespace base { | 17 namespace base { | 
| 16 class FilePath; | 18 class FilePath; | 
| 17 } | 19 } | 
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 108       GURL* allowed_unsafe_redirect_url) override; | 110       GURL* allowed_unsafe_redirect_url) override; | 
| 109 | 111 | 
| 110   // Called right after a redirect response code was received. | 112   // Called right after a redirect response code was received. | 
| 111   // |new_location| is only valid until OnURLRequestDestroyed is called for this | 113   // |new_location| is only valid until OnURLRequestDestroyed is called for this | 
| 112   // request. | 114   // request. | 
| 113   void OnBeforeRedirect(URLRequest* request, const GURL& new_location) override; | 115   void OnBeforeRedirect(URLRequest* request, const GURL& new_location) override; | 
| 114 | 116 | 
| 115   // This corresponds to URLRequestDelegate::OnResponseStarted. | 117   // This corresponds to URLRequestDelegate::OnResponseStarted. | 
| 116   void OnResponseStarted(URLRequest* request) override; | 118   void OnResponseStarted(URLRequest* request) override; | 
| 117 | 119 | 
| 118   // Called every time we read raw bytes. | 120   // Called when bytes are received from the network, such as after receiving | 
| 119   void OnRawBytesRead(const URLRequest& request, int bytes_read) override; | 121   // headers or reading raw response bytes. This includes localhost requests. | 
|  | 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 | 
|  | 124   // time OnNetworkBytesReceived was called. |bytes_received| will always be | 
|  | 125   // greater than 0. | 
|  | 126   // Currently, this is only implemented for HTTP transactions, and | 
|  | 127   // |bytes_received| does not include TLS overhead or TCP retransmits. | 
|  | 128   void OnNetworkBytesReceived(const URLRequest& request, | 
|  | 129                               int64_t bytes_received) override; | 
| 120 | 130 | 
| 121   // Indicates that the URL request has been completed or failed. | 131   // Indicates that the URL request has been completed or failed. | 
| 122   // |started| indicates whether the request has been started. If false, | 132   // |started| indicates whether the request has been started. If false, | 
| 123   // some information like the socket address is not available. | 133   // some information like the socket address is not available. | 
| 124   void OnCompleted(URLRequest* request, bool started) override; | 134   void OnCompleted(URLRequest* request, bool started) override; | 
| 125 | 135 | 
| 126   // Called when an URLRequest is being destroyed. Note that the request is | 136   // 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 | 137   // being deleted, so it's not safe to call any methods that may result in | 
| 128   // a virtual method call. | 138   // a virtual method call. | 
| 129   void OnURLRequestDestroyed(URLRequest* request) override; | 139   void OnURLRequestDestroyed(URLRequest* request) override; | 
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 193   // header is stripped from the request. | 203   // header is stripped from the request. | 
| 194   bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 204   bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 
| 195       const URLRequest& request, | 205       const URLRequest& request, | 
| 196       const GURL& target_url, | 206       const GURL& target_url, | 
| 197       const GURL& referrer_url) const override; | 207       const GURL& referrer_url) const override; | 
| 198 }; | 208 }; | 
| 199 | 209 | 
| 200 }  // namespace net | 210 }  // namespace net | 
| 201 | 211 | 
| 202 #endif  // NET_BASE_NETWORK_DELEGATE_IMPL_H_ | 212 #endif  // NET_BASE_NETWORK_DELEGATE_IMPL_H_ | 
| OLD | NEW | 
|---|