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 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, | 98 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, |
99 const AuthChallengeInfo& auth_info, | 99 const AuthChallengeInfo& auth_info, |
100 const AuthCallback& callback, | 100 const AuthCallback& callback, |
101 AuthCredentials* credentials); | 101 AuthCredentials* credentials); |
102 bool CanGetCookies(const URLRequest& request, | 102 bool CanGetCookies(const URLRequest& request, |
103 const CookieList& cookie_list); | 103 const CookieList& cookie_list); |
104 bool CanSetCookie(const URLRequest& request, | 104 bool CanSetCookie(const URLRequest& request, |
105 const std::string& cookie_line, | 105 const std::string& cookie_line, |
106 CookieOptions* options); | 106 CookieOptions* options); |
107 bool CanAccessFile(const URLRequest& request, | 107 bool CanAccessFile(const URLRequest& request, |
108 const base::FilePath& path) const; | 108 const base::FilePath& original_path, |
| 109 const base::FilePath& absolute_path) const; |
109 bool CanEnablePrivacyMode(const GURL& url, | 110 bool CanEnablePrivacyMode(const GURL& url, |
110 const GURL& first_party_for_cookies) const; | 111 const GURL& first_party_for_cookies) const; |
111 | 112 |
112 bool AreExperimentalCookieFeaturesEnabled() const; | 113 bool AreExperimentalCookieFeaturesEnabled() const; |
113 | 114 |
114 bool CancelURLRequestWithPolicyViolatingReferrerHeader( | 115 bool CancelURLRequestWithPolicyViolatingReferrerHeader( |
115 const URLRequest& request, | 116 const URLRequest& request, |
116 const GURL& target_url, | 117 const GURL& target_url, |
117 const GURL& referrer_url) const; | 118 const GURL& referrer_url) const; |
118 | 119 |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
271 const CookieList& cookie_list) = 0; | 272 const CookieList& cookie_list) = 0; |
272 | 273 |
273 // Called when a cookie is set to allow the network delegate to block access | 274 // Called when a cookie is set to allow the network delegate to block access |
274 // to the cookie. This method will never be invoked when | 275 // to the cookie. This method will never be invoked when |
275 // LOAD_DO_NOT_SAVE_COOKIES is specified. | 276 // LOAD_DO_NOT_SAVE_COOKIES is specified. |
276 virtual bool OnCanSetCookie(const URLRequest& request, | 277 virtual bool OnCanSetCookie(const URLRequest& request, |
277 const std::string& cookie_line, | 278 const std::string& cookie_line, |
278 CookieOptions* options) = 0; | 279 CookieOptions* options) = 0; |
279 | 280 |
280 // Called when a file access is attempted to allow the network delegate to | 281 // Called when a file access is attempted to allow the network delegate to |
281 // allow or block access to the given file path. Returns true if access is | 282 // allow or block access to the given file path, provided in the original |
282 // allowed. | 283 // and absolute forms (i.e. symbolic link is resolved). It's up to |
| 284 // subclasses of NetworkDelegate to decide which path to use for |
| 285 // checking. Returns true if access is allowed. |
283 virtual bool OnCanAccessFile(const URLRequest& request, | 286 virtual bool OnCanAccessFile(const URLRequest& request, |
284 const base::FilePath& path) const = 0; | 287 const base::FilePath& original_path, |
| 288 const base::FilePath& absolute_path) const = 0; |
285 | 289 |
286 // Returns true if the given |url| has to be requested over connection that | 290 // Returns true if the given |url| has to be requested over connection that |
287 // is not tracked by the server. Usually is false, unless user privacy | 291 // is not tracked by the server. Usually is false, unless user privacy |
288 // settings block cookies from being get or set. | 292 // settings block cookies from being get or set. |
289 virtual bool OnCanEnablePrivacyMode( | 293 virtual bool OnCanEnablePrivacyMode( |
290 const GURL& url, | 294 const GURL& url, |
291 const GURL& first_party_for_cookies) const = 0; | 295 const GURL& first_party_for_cookies) const = 0; |
292 | 296 |
293 // Returns true if the embedder has enabled the experimental features, and | 297 // Returns true if the embedder has enabled the experimental features, and |
294 // false otherwise. | 298 // false otherwise. |
(...skipping 16 matching lines...) Expand all Loading... |
311 virtual bool OnCanSetReportingClient(const url::Origin& origin, | 315 virtual bool OnCanSetReportingClient(const url::Origin& origin, |
312 const GURL& endpoint) const = 0; | 316 const GURL& endpoint) const = 0; |
313 | 317 |
314 virtual bool OnCanUseReportingClient(const url::Origin& origin, | 318 virtual bool OnCanUseReportingClient(const url::Origin& origin, |
315 const GURL& endpoint) const = 0; | 319 const GURL& endpoint) const = 0; |
316 }; | 320 }; |
317 | 321 |
318 } // namespace net | 322 } // namespace net |
319 | 323 |
320 #endif // NET_BASE_NETWORK_DELEGATE_H_ | 324 #endif // NET_BASE_NETWORK_DELEGATE_H_ |
OLD | NEW |