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 <string> | 8 #include <string> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 // | 31 // |
32 // NOTE: It is not okay to add any compile-time dependencies on symbols outside | 32 // NOTE: It is not okay to add any compile-time dependencies on symbols outside |
33 // of net/base here, because we have a net_base library. Forward declarations | 33 // of net/base here, because we have a net_base library. Forward declarations |
34 // are ok. | 34 // are ok. |
35 class CookieOptions; | 35 class CookieOptions; |
36 class HttpRequestHeaders; | 36 class HttpRequestHeaders; |
37 class HttpResponseHeaders; | 37 class HttpResponseHeaders; |
38 class ProxyInfo; | 38 class ProxyInfo; |
39 class ProxyServer; | 39 class ProxyServer; |
40 class ProxyService; | 40 class ProxyService; |
41 class SocketStream; | |
42 class URLRequest; | 41 class URLRequest; |
43 | 42 |
44 class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { | 43 class NET_EXPORT NetworkDelegate : public base::NonThreadSafe { |
45 public: | 44 public: |
46 // AuthRequiredResponse indicates how a NetworkDelegate handles an | 45 // AuthRequiredResponse indicates how a NetworkDelegate handles an |
47 // OnAuthRequired call. It's placed in this file to prevent url_request.h | 46 // OnAuthRequired call. It's placed in this file to prevent url_request.h |
48 // from having to include network_delegate.h. | 47 // from having to include network_delegate.h. |
49 enum AuthRequiredResponse { | 48 enum AuthRequiredResponse { |
50 AUTH_REQUIRED_RESPONSE_NO_ACTION, | 49 AUTH_REQUIRED_RESPONSE_NO_ACTION, |
51 AUTH_REQUIRED_RESPONSE_SET_AUTH, | 50 AUTH_REQUIRED_RESPONSE_SET_AUTH, |
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 // request is overloaded or down. | 260 // request is overloaded or down. |
262 virtual bool OnCanThrottleRequest(const URLRequest& request) const; | 261 virtual bool OnCanThrottleRequest(const URLRequest& request) const; |
263 | 262 |
264 // Returns true if the given |url| has to be requested over connection that | 263 // Returns true if the given |url| has to be requested over connection that |
265 // is not tracked by the server. Usually is false, unless user privacy | 264 // is not tracked by the server. Usually is false, unless user privacy |
266 // settings block cookies from being get or set. | 265 // settings block cookies from being get or set. |
267 virtual bool OnCanEnablePrivacyMode( | 266 virtual bool OnCanEnablePrivacyMode( |
268 const GURL& url, | 267 const GURL& url, |
269 const GURL& first_party_for_cookies) const; | 268 const GURL& first_party_for_cookies) const; |
270 | 269 |
271 // Called before a SocketStream tries to connect. | |
272 // See OnBeforeURLRequest for return value description. Returns OK by default. | |
273 virtual int OnBeforeSocketStreamConnect( | |
274 SocketStream* socket, const CompletionCallback& callback); | |
275 | |
276 // Called when the |referrer_url| for requesting |target_url| during handling | 270 // Called when the |referrer_url| for requesting |target_url| during handling |
277 // of the |request| is does not comply with the referrer policy (e.g. a | 271 // of the |request| is does not comply with the referrer policy (e.g. a |
278 // secure referrer for an insecure initial target). | 272 // secure referrer for an insecure initial target). |
279 // Returns true if the request should be cancelled. Otherwise, the referrer | 273 // Returns true if the request should be cancelled. Otherwise, the referrer |
280 // header is stripped from the request. | 274 // header is stripped from the request. |
281 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 275 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
282 const URLRequest& request, | 276 const URLRequest& request, |
283 const GURL& target_url, | 277 const GURL& target_url, |
284 const GURL& referrer_url) const; | 278 const GURL& referrer_url) const; |
285 }; | 279 }; |
286 | 280 |
287 } // namespace net | 281 } // namespace net |
288 | 282 |
289 #endif // NET_BASE_NETWORK_DELEGATE_H_ | 283 #endif // NET_BASE_NETWORK_DELEGATE_H_ |
OLD | NEW |