Chromium Code Reviews| 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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 94 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, | 94 AuthRequiredResponse NotifyAuthRequired(URLRequest* request, |
| 95 const AuthChallengeInfo& auth_info, | 95 const AuthChallengeInfo& auth_info, |
| 96 const AuthCallback& callback, | 96 const AuthCallback& callback, |
| 97 AuthCredentials* credentials); | 97 AuthCredentials* credentials); |
| 98 bool CanGetCookies(const URLRequest& request, | 98 bool CanGetCookies(const URLRequest& request, |
| 99 const CookieList& cookie_list); | 99 const CookieList& cookie_list); |
| 100 bool CanSetCookie(const URLRequest& request, | 100 bool CanSetCookie(const URLRequest& request, |
| 101 const std::string& cookie_line, | 101 const std::string& cookie_line, |
| 102 CookieOptions* options); | 102 CookieOptions* options); |
| 103 bool CanAccessFile(const URLRequest& request, | 103 bool CanAccessFile(const URLRequest& request, |
| 104 const base::FilePath& path) const; | 104 const base::FilePath& original_path, |
| 105 const base::FilePath& absolute_path) const; | |
| 105 bool CanEnablePrivacyMode(const GURL& url, | 106 bool CanEnablePrivacyMode(const GURL& url, |
| 106 const GURL& first_party_for_cookies) const; | 107 const GURL& first_party_for_cookies) const; |
| 107 | 108 |
| 108 bool AreExperimentalCookieFeaturesEnabled() const; | 109 bool AreExperimentalCookieFeaturesEnabled() const; |
| 109 | 110 |
| 110 bool CancelURLRequestWithPolicyViolatingReferrerHeader( | 111 bool CancelURLRequestWithPolicyViolatingReferrerHeader( |
| 111 const URLRequest& request, | 112 const URLRequest& request, |
| 112 const GURL& target_url, | 113 const GURL& target_url, |
| 113 const GURL& referrer_url) const; | 114 const GURL& referrer_url) const; |
| 114 | 115 |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 260 const CookieList& cookie_list) = 0; | 261 const CookieList& cookie_list) = 0; |
| 261 | 262 |
| 262 // Called when a cookie is set to allow the network delegate to block access | 263 // Called when a cookie is set to allow the network delegate to block access |
| 263 // to the cookie. This method will never be invoked when | 264 // to the cookie. This method will never be invoked when |
| 264 // LOAD_DO_NOT_SAVE_COOKIES is specified. | 265 // LOAD_DO_NOT_SAVE_COOKIES is specified. |
| 265 virtual bool OnCanSetCookie(const URLRequest& request, | 266 virtual bool OnCanSetCookie(const URLRequest& request, |
| 266 const std::string& cookie_line, | 267 const std::string& cookie_line, |
| 267 CookieOptions* options) = 0; | 268 CookieOptions* options) = 0; |
| 268 | 269 |
| 269 // Called when a file access is attempted to allow the network delegate to | 270 // Called when a file access is attempted to allow the network delegate to |
| 270 // allow or block access to the given file path. Returns true if access is | 271 // allow or block access to the given file path, provided in the original |
| 271 // allowed. | 272 // and absolute forms (i.e. symbolic link is resolved). It's up to the sub |
| 273 // class to decide which path to use for checking. Returns true if access | |
| 274 // is allowed. | |
|
mmenke
2017/04/18 17:24:45
subclass of what? (Also, subclass is one word)
satorux1
2017/04/21 08:05:37
Done.
| |
| 272 virtual bool OnCanAccessFile(const URLRequest& request, | 275 virtual bool OnCanAccessFile(const URLRequest& request, |
| 273 const base::FilePath& path) const = 0; | 276 const base::FilePath& original_path, |
| 277 const base::FilePath& absolute_path) const = 0; | |
| 274 | 278 |
| 275 // Returns true if the given |url| has to be requested over connection that | 279 // Returns true if the given |url| has to be requested over connection that |
| 276 // is not tracked by the server. Usually is false, unless user privacy | 280 // is not tracked by the server. Usually is false, unless user privacy |
| 277 // settings block cookies from being get or set. | 281 // settings block cookies from being get or set. |
| 278 virtual bool OnCanEnablePrivacyMode( | 282 virtual bool OnCanEnablePrivacyMode( |
| 279 const GURL& url, | 283 const GURL& url, |
| 280 const GURL& first_party_for_cookies) const = 0; | 284 const GURL& first_party_for_cookies) const = 0; |
| 281 | 285 |
| 282 // Returns true if the embedder has enabled the experimental features, and | 286 // Returns true if the embedder has enabled the experimental features, and |
| 283 // false otherwise. | 287 // false otherwise. |
| 284 virtual bool OnAreExperimentalCookieFeaturesEnabled() const = 0; | 288 virtual bool OnAreExperimentalCookieFeaturesEnabled() const = 0; |
| 285 | 289 |
| 286 // Called when the |referrer_url| for requesting |target_url| during handling | 290 // Called when the |referrer_url| for requesting |target_url| during handling |
| 287 // of the |request| is does not comply with the referrer policy (e.g. a | 291 // of the |request| is does not comply with the referrer policy (e.g. a |
| 288 // secure referrer for an insecure initial target). | 292 // secure referrer for an insecure initial target). |
| 289 // Returns true if the request should be cancelled. Otherwise, the referrer | 293 // Returns true if the request should be cancelled. Otherwise, the referrer |
| 290 // header is stripped from the request. | 294 // header is stripped from the request. |
| 291 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( | 295 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( |
| 292 const URLRequest& request, | 296 const URLRequest& request, |
| 293 const GURL& target_url, | 297 const GURL& target_url, |
| 294 const GURL& referrer_url) const = 0; | 298 const GURL& referrer_url) const = 0; |
| 295 }; | 299 }; |
| 296 | 300 |
| 297 } // namespace net | 301 } // namespace net |
| 298 | 302 |
| 299 #endif // NET_BASE_NETWORK_DELEGATE_H_ | 303 #endif // NET_BASE_NETWORK_DELEGATE_H_ |
| OLD | NEW |