OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_H_ | 5 #ifndef NET_BASE_NETWORK_DELEGATE_H_ |
6 #define NET_BASE_NETWORK_DELEGATE_H_ | 6 #define NET_BASE_NETWORK_DELEGATE_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 const HttpResponseHeaders* original_response_headers, | 84 const HttpResponseHeaders* original_response_headers, |
85 scoped_refptr<HttpResponseHeaders>* override_response_headers, | 85 scoped_refptr<HttpResponseHeaders>* override_response_headers, |
86 GURL* allowed_unsafe_redirect_url); | 86 GURL* allowed_unsafe_redirect_url); |
87 void NotifyBeforeRedirect(URLRequest* request, | 87 void NotifyBeforeRedirect(URLRequest* request, |
88 const GURL& new_location); | 88 const GURL& new_location); |
89 void NotifyResponseStarted(URLRequest* request); | 89 void NotifyResponseStarted(URLRequest* request); |
90 void NotifyNetworkBytesReceived(const URLRequest& request, | 90 void NotifyNetworkBytesReceived(const URLRequest& request, |
91 int64_t bytes_received); | 91 int64_t bytes_received); |
92 void NotifyCompleted(URLRequest* request, bool started); | 92 void NotifyCompleted(URLRequest* request, bool started); |
93 void NotifyURLRequestDestroyed(URLRequest* request); | 93 void NotifyURLRequestDestroyed(URLRequest* request); |
| 94 void NotifyURLRequestJobOrphaned(URLRequest* request); |
94 void NotifyPACScriptError(int line_number, const base::string16& error); | 95 void NotifyPACScriptError(int line_number, const base::string16& error); |
95 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, | 96 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, |
96 const AuthChallengeInfo& auth_info, | 97 const AuthChallengeInfo& auth_info, |
97 const AuthCallback& callback, | 98 const AuthCallback& callback, |
98 AuthCredentials* credentials); | 99 AuthCredentials* credentials); |
99 bool CanGetCookies(const URLRequest& request, | 100 bool CanGetCookies(const URLRequest& request, |
100 const CookieList& cookie_list); | 101 const CookieList& cookie_list); |
101 bool CanSetCookie(const URLRequest& request, | 102 bool CanSetCookie(const URLRequest& request, |
102 const std::string& cookie_line, | 103 const std::string& cookie_line, |
103 CookieOptions* options); | 104 CookieOptions* options); |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // Indicates that the URL request has been completed or failed. | 216 // Indicates that the URL request has been completed or failed. |
216 // |started| indicates whether the request has been started. If false, | 217 // |started| indicates whether the request has been started. If false, |
217 // some information like the socket address is not available. | 218 // some information like the socket address is not available. |
218 virtual void OnCompleted(URLRequest* request, bool started) = 0; | 219 virtual void OnCompleted(URLRequest* request, bool started) = 0; |
219 | 220 |
220 // Called when an URLRequest is being destroyed. Note that the request is | 221 // Called when an URLRequest is being destroyed. Note that the request is |
221 // being deleted, so it's not safe to call any methods that may result in | 222 // being deleted, so it's not safe to call any methods that may result in |
222 // a virtual method call. | 223 // a virtual method call. |
223 virtual void OnURLRequestDestroyed(URLRequest* request) = 0; | 224 virtual void OnURLRequestDestroyed(URLRequest* request) = 0; |
224 | 225 |
| 226 // Called when the current job for |request| is orphaned. This is a temporary |
| 227 // callback to diagnose https://crbug.com/289715 and may not be used for other |
| 228 // purposes. Note that it may be called after OnURLRequestDestroyed. |
| 229 // |
| 230 // TODO(davidben): Remove this once data has been gathered. |
| 231 virtual void OnURLRequestJobOrphaned(URLRequest* request) = 0; |
| 232 |
225 // Corresponds to ProxyResolverJSBindings::OnError. | 233 // Corresponds to ProxyResolverJSBindings::OnError. |
226 virtual void OnPACScriptError(int line_number, | 234 virtual void OnPACScriptError(int line_number, |
227 const base::string16& error) = 0; | 235 const base::string16& error) = 0; |
228 | 236 |
229 // Called when a request receives an authentication challenge | 237 // Called when a request receives an authentication challenge |
230 // specified by |auth_info|, and is unable to respond using cached | 238 // specified by |auth_info|, and is unable to respond using cached |
231 // credentials. |callback| and |credentials| must be non-NULL, and must | 239 // credentials. |callback| and |credentials| must be non-NULL, and must |
232 // be valid until OnURLRequestDestroyed is called for |request|. | 240 // be valid until OnURLRequestDestroyed is called for |request|. |
233 // | 241 // |
234 // The following return values are allowed: | 242 // The following return values are allowed: |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 // header is stripped from the request. | 297 // header is stripped from the request. |
290 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 298 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
291 const URLRequest& request, | 299 const URLRequest& request, |
292 const GURL& target_url, | 300 const GURL& target_url, |
293 const GURL& referrer_url) const = 0; | 301 const GURL& referrer_url) const = 0; |
294 }; | 302 }; |
295 | 303 |
296 } // namespace net | 304 } // namespace net |
297 | 305 |
298 #endif // NET_BASE_NETWORK_DELEGATE_H_ | 306 #endif // NET_BASE_NETWORK_DELEGATE_H_ |
OLD | NEW |