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

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

Issue 1032063002: Enable 'First-Party-Only' cookies by default. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Friend. Created 5 years, 9 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
« no previous file with comments | « net/base/layered_network_delegate.cc ('k') | net/base/network_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
111 bool CancelURLRequestWithPolicyViolatingReferrerHeader( 107 bool CancelURLRequestWithPolicyViolatingReferrerHeader(
112 const URLRequest& request, 108 const URLRequest& request,
113 const GURL& target_url, 109 const GURL& target_url,
114 const GURL& referrer_url) const; 110 const GURL& referrer_url) const;
115 111
116 private: 112 private:
117 // This is the interface for subclasses of NetworkDelegate to implement. These 113 // This is the interface for subclasses of NetworkDelegate to implement. These
118 // member functions will be called by the respective public notification 114 // member functions will be called by the respective public notification
119 // member function, which will perform basic sanity checking. 115 // member function, which will perform basic sanity checking.
120 116
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after
263 // request is overloaded or down. 259 // request is overloaded or down.
264 virtual bool OnCanThrottleRequest(const URLRequest& request) const = 0; 260 virtual bool OnCanThrottleRequest(const URLRequest& request) const = 0;
265 261
266 // Returns true if the given |url| has to be requested over connection that 262 // Returns true if the given |url| has to be requested over connection that
267 // is not tracked by the server. Usually is false, unless user privacy 263 // is not tracked by the server. Usually is false, unless user privacy
268 // settings block cookies from being get or set. 264 // settings block cookies from being get or set.
269 virtual bool OnCanEnablePrivacyMode( 265 virtual bool OnCanEnablePrivacyMode(
270 const GURL& url, 266 const GURL& url,
271 const GURL& first_party_for_cookies) const = 0; 267 const GURL& first_party_for_cookies) const = 0;
272 268
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
280 // Called when the |referrer_url| for requesting |target_url| during handling 269 // Called when the |referrer_url| for requesting |target_url| during handling
281 // of the |request| is does not comply with the referrer policy (e.g. a 270 // of the |request| is does not comply with the referrer policy (e.g. a
282 // secure referrer for an insecure initial target). 271 // secure referrer for an insecure initial target).
283 // Returns true if the request should be cancelled. Otherwise, the referrer 272 // Returns true if the request should be cancelled. Otherwise, the referrer
284 // header is stripped from the request. 273 // header is stripped from the request.
285 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( 274 virtual bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
286 const URLRequest& request, 275 const URLRequest& request,
287 const GURL& target_url, 276 const GURL& target_url,
288 const GURL& referrer_url) const = 0; 277 const GURL& referrer_url) const = 0;
289 }; 278 };
290 279
291 } // namespace net 280 } // namespace net
292 281
293 #endif // NET_BASE_NETWORK_DELEGATE_H_ 282 #endif // NET_BASE_NETWORK_DELEGATE_H_
OLDNEW
« no previous file with comments | « net/base/layered_network_delegate.cc ('k') | net/base/network_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698