Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(493)

Side by Side Diff: net/base/network_delegate.h

Issue 940373002: First-Party Cookies: Wire it up as an experimental web platform feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@first-party
Patch Set: Feedback. Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
97 const CookieList& cookie_list); 97 const CookieList& cookie_list);
98 bool CanSetCookie(const URLRequest& request, 98 bool CanSetCookie(const URLRequest& request,
99 const std::string& cookie_line, 99 const std::string& cookie_line,
100 CookieOptions* options); 100 CookieOptions* options);
101 bool CanAccessFile(const URLRequest& request, 101 bool CanAccessFile(const URLRequest& request,
102 const base::FilePath& path) const; 102 const base::FilePath& path) const;
103 bool CanThrottleRequest(const URLRequest& request) const; 103 bool CanThrottleRequest(const URLRequest& request) const;
104 bool CanEnablePrivacyMode(const GURL& url, 104 bool CanEnablePrivacyMode(const GURL& url,
105 const GURL& first_party_for_cookies) const; 105 const GURL& first_party_for_cookies) const;
106 106
107 // TODO(mkwst): Remove this once we decide whether or not we wish to ship
108 // first-party cookies. https://crbug.com/459154
109 bool FirstPartyOnlyCookieExperimentEnabled() const;
110
107 bool CancelURLRequestWithPolicyViolatingReferrerHeader( 111 bool CancelURLRequestWithPolicyViolatingReferrerHeader(
108 const URLRequest& request, 112 const URLRequest& request,
109 const GURL& target_url, 113 const GURL& target_url,
110 const GURL& referrer_url) const; 114 const GURL& referrer_url) const;
111 115
112 private: 116 private:
113 // This is the interface for subclasses of NetworkDelegate to implement. These 117 // This is the interface for subclasses of NetworkDelegate to implement. These
114 // member functions will be called by the respective public notification 118 // member functions will be called by the respective public notification
115 // member function, which will perform basic sanity checking. 119 // member function, which will perform basic sanity checking.
116 120
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 // request is overloaded or down. 263 // request is overloaded or down.
260 virtual bool OnCanThrottleRequest(const URLRequest& request) const = 0; 264 virtual bool OnCanThrottleRequest(const URLRequest& request) const = 0;
261 265
262 // Returns true if the given |url| has to be requested over connection that 266 // Returns true if the given |url| has to be requested over connection that
263 // is not tracked by the server. Usually is false, unless user privacy 267 // is not tracked by the server. Usually is false, unless user privacy
264 // settings block cookies from being get or set. 268 // settings block cookies from being get or set.
265 virtual bool OnCanEnablePrivacyMode( 269 virtual bool OnCanEnablePrivacyMode(
266 const GURL& url, 270 const GURL& url,
267 const GURL& first_party_for_cookies) const = 0; 271 const GURL& first_party_for_cookies) const = 0;
268 272
273 // Returns true if the embedder has enabled the "first-party" cookie
274 // experiment, and false otherwise.
275 //
276 // TODO(mkwst): Remove this once we decide whether or not we wish to ship
277 // first-party cookies. https://crbug.com/459154
278 virtual bool OnFirstPartyOnlyCookieExperimentEnabled() const = 0;
279
269 // Called when the |referrer_url| for requesting |target_url| during handling 280 // Called when the |referrer_url| for requesting |target_url| during handling
270 // of the |request| is does not comply with the referrer policy (e.g. a 281 // of the |request| is does not comply with the referrer policy (e.g. a
271 // secure referrer for an insecure initial target). 282 // secure referrer for an insecure initial target).
272 // Returns true if the request should be cancelled. Otherwise, the referrer 283 // Returns true if the request should be cancelled. Otherwise, the referrer
273 // header is stripped from the request. 284 // header is stripped from the request.
274 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( 285 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
275 const URLRequest& request, 286 const URLRequest& request,
276 const GURL& target_url, 287 const GURL& target_url,
277 const GURL& referrer_url) const = 0; 288 const GURL& referrer_url) const = 0;
278 }; 289 };
279 290
280 } // namespace net 291 } // namespace net
281 292
282 #endif // NET_BASE_NETWORK_DELEGATE_H_ 293 #endif // NET_BASE_NETWORK_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698