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

Side by Side Diff: net/url_request/url_request_test_util.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/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_test_util.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_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 5 #ifndef NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 6 #define NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
7 7
8 #include <stdlib.h> 8 #include <stdlib.h>
9 9
10 #include <map> 10 #include <map>
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 int destroyed_requests() const { return destroyed_requests_; } 258 int destroyed_requests() const { return destroyed_requests_; }
259 int completed_requests() const { return completed_requests_; } 259 int completed_requests() const { return completed_requests_; }
260 int canceled_requests() const { return canceled_requests_; } 260 int canceled_requests() const { return canceled_requests_; }
261 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; } 261 int blocked_get_cookies_count() const { return blocked_get_cookies_count_; }
262 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; } 262 int blocked_set_cookie_count() const { return blocked_set_cookie_count_; }
263 int set_cookie_count() const { return set_cookie_count_; } 263 int set_cookie_count() const { return set_cookie_count_; }
264 264
265 void set_can_access_files(bool val) { can_access_files_ = val; } 265 void set_can_access_files(bool val) { can_access_files_ = val; }
266 bool can_access_files() const { return can_access_files_; } 266 bool can_access_files() const { return can_access_files_; }
267 267
268 void set_first_party_only_cookies_enabled(bool val) {
269 first_party_only_cookies_enabled_ = val;
270 }
271
272 void set_can_throttle_requests(bool val) { can_throttle_requests_ = val; } 268 void set_can_throttle_requests(bool val) { can_throttle_requests_ = val; }
273 bool can_throttle_requests() const { return can_throttle_requests_; } 269 bool can_throttle_requests() const { return can_throttle_requests_; }
274 270
275 void set_cancel_request_with_policy_violating_referrer(bool val) { 271 void set_cancel_request_with_policy_violating_referrer(bool val) {
276 cancel_request_with_policy_violating_referrer_ = val; 272 cancel_request_with_policy_violating_referrer_ = val;
277 } 273 }
278 274
279 int observed_before_proxy_headers_sent_callbacks() const { 275 int observed_before_proxy_headers_sent_callbacks() const {
280 return observed_before_proxy_headers_sent_callbacks_; 276 return observed_before_proxy_headers_sent_callbacks_;
281 } 277 }
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
322 const AuthCallback& callback, 318 const AuthCallback& callback,
323 AuthCredentials* credentials) override; 319 AuthCredentials* credentials) override;
324 bool OnCanGetCookies(const URLRequest& request, 320 bool OnCanGetCookies(const URLRequest& request,
325 const CookieList& cookie_list) override; 321 const CookieList& cookie_list) override;
326 bool OnCanSetCookie(const URLRequest& request, 322 bool OnCanSetCookie(const URLRequest& request,
327 const std::string& cookie_line, 323 const std::string& cookie_line,
328 CookieOptions* options) override; 324 CookieOptions* options) override;
329 bool OnCanAccessFile(const URLRequest& request, 325 bool OnCanAccessFile(const URLRequest& request,
330 const base::FilePath& path) const override; 326 const base::FilePath& path) const override;
331 bool OnCanThrottleRequest(const URLRequest& request) const override; 327 bool OnCanThrottleRequest(const URLRequest& request) const override;
332 bool OnFirstPartyOnlyCookieExperimentEnabled() const override;
333 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader( 328 bool OnCancelURLRequestWithPolicyViolatingReferrerHeader(
334 const URLRequest& request, 329 const URLRequest& request,
335 const GURL& target_url, 330 const GURL& target_url,
336 const GURL& referrer_url) const override; 331 const GURL& referrer_url) const override;
337 332
338 void InitRequestStatesIfNew(int request_id); 333 void InitRequestStatesIfNew(int request_id);
339 334
340 GURL redirect_on_headers_received_url_; 335 GURL redirect_on_headers_received_url_;
341 // URL marked as safe for redirection at the onHeadersReceived stage. 336 // URL marked as safe for redirection at the onHeadersReceived stage.
342 GURL allowed_unsafe_redirect_url_; 337 GURL allowed_unsafe_redirect_url_;
(...skipping 25 matching lines...) Expand all
368 std::map<int, std::string> event_order_; 363 std::map<int, std::string> event_order_;
369 364
370 LoadTimingInfo load_timing_info_before_redirect_; 365 LoadTimingInfo load_timing_info_before_redirect_;
371 bool has_load_timing_info_before_redirect_; 366 bool has_load_timing_info_before_redirect_;
372 367
373 LoadTimingInfo load_timing_info_before_auth_; 368 LoadTimingInfo load_timing_info_before_auth_;
374 bool has_load_timing_info_before_auth_; 369 bool has_load_timing_info_before_auth_;
375 370
376 bool can_access_files_; // true by default 371 bool can_access_files_; // true by default
377 bool can_throttle_requests_; // true by default 372 bool can_throttle_requests_; // true by default
378 bool first_party_only_cookies_enabled_; // false by default
379 bool cancel_request_with_policy_violating_referrer_; // false by default 373 bool cancel_request_with_policy_violating_referrer_; // false by default
380 bool will_be_intercepted_on_next_error_; 374 bool will_be_intercepted_on_next_error_;
381 }; 375 };
382 376
383 // Overrides the host used by the LocalHttpTestServer in 377 // Overrides the host used by the LocalHttpTestServer in
384 // url_request_unittest.cc . This is used by the chrome_frame_net_tests due to 378 // url_request_unittest.cc . This is used by the chrome_frame_net_tests due to
385 // a mysterious bug when tests execute over the loopback adapter. See 379 // a mysterious bug when tests execute over the loopback adapter. See
386 // http://crbug.com/114369 . 380 // http://crbug.com/114369 .
387 class ScopedCustomUrlRequestTestHttpHost { 381 class ScopedCustomUrlRequestTestHttpHost {
388 public: 382 public:
(...skipping 28 matching lines...) Expand all
417 NetworkDelegate* network_delegate) const override; 411 NetworkDelegate* network_delegate) const override;
418 void set_main_intercept_job(URLRequestJob* job); 412 void set_main_intercept_job(URLRequestJob* job);
419 413
420 private: 414 private:
421 mutable URLRequestJob* main_intercept_job_; 415 mutable URLRequestJob* main_intercept_job_;
422 }; 416 };
423 417
424 } // namespace net 418 } // namespace net
425 419
426 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_ 420 #endif // NET_URL_REQUEST_URL_REQUEST_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « net/url_request/url_request_http_job.cc ('k') | net/url_request/url_request_test_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698