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

Side by Side Diff: net/url_request/url_request_http_job.cc

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/network_delegate_impl.cc ('k') | net/url_request/url_request_test_util.h » ('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 #include "net/url_request/url_request_http_job.h" 5 #include "net/url_request/url_request_http_job.h"
6 6
7 #include "base/base_switches.h" 7 #include "base/base_switches.h"
8 #include "base/bind.h" 8 #include "base/bind.h"
9 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 base::Bind(&URLRequestHttpJob::CheckCookiePolicyAndLoad, 608 base::Bind(&URLRequestHttpJob::CheckCookiePolicyAndLoad,
609 weak_factory_.GetWeakPtr())); 609 weak_factory_.GetWeakPtr()));
610 } else { 610 } else {
611 DoStartTransaction(); 611 DoStartTransaction();
612 } 612 }
613 } 613 }
614 614
615 void URLRequestHttpJob::DoLoadCookies() { 615 void URLRequestHttpJob::DoLoadCookies() {
616 CookieOptions options; 616 CookieOptions options;
617 options.set_include_httponly(); 617 options.set_include_httponly();
618 618 options.set_first_party_url(request_->first_party_for_cookies());
619 // TODO(mkwst): Drop this `if` once we decide whether or not to ship
620 // first-party cookies: https://crbug.com/459154
621 if (network_delegate() &&
622 network_delegate()->FirstPartyOnlyCookieExperimentEnabled())
623 options.set_first_party_url(request_->first_party_for_cookies());
624 else
625 options.set_include_first_party_only();
626 619
627 request_->context()->cookie_store()->GetCookiesWithOptionsAsync( 620 request_->context()->cookie_store()->GetCookiesWithOptionsAsync(
628 request_->url(), options, base::Bind(&URLRequestHttpJob::OnCookiesLoaded, 621 request_->url(), options, base::Bind(&URLRequestHttpJob::OnCookiesLoaded,
629 weak_factory_.GetWeakPtr())); 622 weak_factory_.GetWeakPtr()));
630 } 623 }
631 624
632 void URLRequestHttpJob::CheckCookiePolicyAndLoad( 625 void URLRequestHttpJob::CheckCookiePolicyAndLoad(
633 const CookieList& cookie_list) { 626 const CookieList& cookie_list) {
634 if (CanGetCookies(cookie_list)) 627 if (CanGetCookies(cookie_list))
635 DoLoadCookies(); 628 DoLoadCookies();
(...skipping 851 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 return override_response_headers_.get() ? 1480 return override_response_headers_.get() ?
1488 override_response_headers_.get() : 1481 override_response_headers_.get() :
1489 transaction_->GetResponseInfo()->headers.get(); 1482 transaction_->GetResponseInfo()->headers.get();
1490 } 1483 }
1491 1484
1492 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1485 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1493 awaiting_callback_ = false; 1486 awaiting_callback_ = false;
1494 } 1487 }
1495 1488
1496 } // namespace net 1489 } // namespace net
OLDNEW
« no previous file with comments | « net/base/network_delegate_impl.cc ('k') | net/url_request/url_request_test_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698