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

Side by Side Diff: chrome/browser/net/chrome_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: 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 CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 6 #define CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 domain_reliability_monitor_ = monitor; 121 domain_reliability_monitor_ = monitor;
122 } 122 }
123 123
124 void set_prerender_tracker(prerender::PrerenderTracker* prerender_tracker) { 124 void set_prerender_tracker(prerender::PrerenderTracker* prerender_tracker) {
125 prerender_tracker_ = prerender_tracker; 125 prerender_tracker_ = prerender_tracker;
126 } 126 }
127 127
128 // Adds the Client Hints header to HTTP requests. 128 // Adds the Client Hints header to HTTP requests.
129 void SetEnableClientHints(); 129 void SetEnableClientHints();
130 130
131 // Notes that "experimental web platform features" are enabled, which in turn
132 // can enable web-facing //net experiments.
133 void SetExperimentalWebPlatformFeaturesEnabled();
134
131 // Causes |OnCanThrottleRequest| to always return false, for all 135 // Causes |OnCanThrottleRequest| to always return false, for all
132 // instances of this object. 136 // instances of this object.
133 static void NeverThrottleRequests(); 137 static void NeverThrottleRequests();
134 138
135 // Binds the pref members to |pref_service| and moves them to the IO thread. 139 // Binds the pref members to |pref_service| and moves them to the IO thread.
136 // |enable_referrers| cannot be NULL, the others can. 140 // |enable_referrers| cannot be NULL, the others can.
137 // This method should be called on the UI thread. 141 // This method should be called on the UI thread.
138 static void InitializePrefsOnUIThread( 142 static void InitializePrefsOnUIThread(
139 BooleanPrefMember* enable_referrers, 143 BooleanPrefMember* enable_referrers,
140 BooleanPrefMember* enable_do_not_track, 144 BooleanPrefMember* enable_do_not_track,
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 const net::CookieList& cookie_list) override; 185 const net::CookieList& cookie_list) override;
182 bool OnCanSetCookie(const net::URLRequest& request, 186 bool OnCanSetCookie(const net::URLRequest& request,
183 const std::string& cookie_line, 187 const std::string& cookie_line,
184 net::CookieOptions* options) override; 188 net::CookieOptions* options) override;
185 bool OnCanAccessFile(const net::URLRequest& request, 189 bool OnCanAccessFile(const net::URLRequest& request,
186 const base::FilePath& path) const override; 190 const base::FilePath& path) const override;
187 bool OnCanThrottleRequest(const net::URLRequest& request) const override; 191 bool OnCanThrottleRequest(const net::URLRequest& request) const override;
188 bool OnCanEnablePrivacyMode( 192 bool OnCanEnablePrivacyMode(
189 const GURL& url, 193 const GURL& url,
190 const GURL& first_party_for_cookies) const override; 194 const GURL& first_party_for_cookies) const override;
195 bool OnFirstPartyCookieExperimentEnabled() const override;
191 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( 196 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
192 const net::URLRequest& request, 197 const net::URLRequest& request,
193 const GURL& target_url, 198 const GURL& target_url,
194 const GURL& referrer_url) const override; 199 const GURL& referrer_url) const override;
195 200
196 void AccumulateContentLength( 201 void AccumulateContentLength(
197 int64 received_payload_byte_count, 202 int64 received_payload_byte_count,
198 int64 original_payload_byte_count); 203 int64 original_payload_byte_count);
199 204
200 scoped_ptr<ChromeExtensionsNetworkDelegate> extensions_delegate_; 205 scoped_ptr<ChromeExtensionsNetworkDelegate> extensions_delegate_;
(...skipping 22 matching lines...) Expand all
223 228
224 // True if OnCanThrottleRequest should always return false. 229 // True if OnCanThrottleRequest should always return false.
225 // 230 //
226 // Note: This needs to be static as the instance of 231 // Note: This needs to be static as the instance of
227 // ChromeNetworkDelegate used may change over time, and we need to 232 // ChromeNetworkDelegate used may change over time, and we need to
228 // set this variable once at start-up time. It is effectively 233 // set this variable once at start-up time. It is effectively
229 // static anyway since it is based on a command-line flag. 234 // static anyway since it is based on a command-line flag.
230 static bool g_never_throttle_requests_; 235 static bool g_never_throttle_requests_;
231 236
232 scoped_ptr<ClientHints> client_hints_; 237 scoped_ptr<ClientHints> client_hints_;
238 bool experimental_web_platform_features_enabled_;
233 239
234 bool first_request_; 240 bool first_request_;
235 241
236 prerender::PrerenderTracker* prerender_tracker_; 242 prerender::PrerenderTracker* prerender_tracker_;
237 243
238 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate); 244 DISALLOW_COPY_AND_ASSIGN(ChromeNetworkDelegate);
239 }; 245 };
240 246
241 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_ 247 #endif // CHROME_BROWSER_NET_CHROME_NETWORK_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/net/chrome_network_delegate.cc » ('j') | chrome/browser/net/chrome_network_delegate.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698