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

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

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: Rebase. 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 #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 611 matching lines...) Expand 10 before | Expand all | Expand 10 after
622 base::Bind(&URLRequestHttpJob::CheckCookiePolicyAndLoad, 622 base::Bind(&URLRequestHttpJob::CheckCookiePolicyAndLoad,
623 weak_factory_.GetWeakPtr())); 623 weak_factory_.GetWeakPtr()));
624 } else { 624 } else {
625 DoStartTransaction(); 625 DoStartTransaction();
626 } 626 }
627 } 627 }
628 628
629 void URLRequestHttpJob::DoLoadCookies() { 629 void URLRequestHttpJob::DoLoadCookies() {
630 CookieOptions options; 630 CookieOptions options;
631 options.set_include_httponly(); 631 options.set_include_httponly();
632 options.set_include_first_party_only();
633 632
634 // TODO(mkwst): Pipe a switch down here to allow us to decide whether we 633 // TODO(mkwst): Drop this `if` once we decide whether or not to ship
635 // should enforce "first-party only" cookies or not (by setting |options|'s 634 // first-party cookies: https://crbug.com/459154
636 // first-party-url to the first-party-for-cookies value. crbug.com/459154 635 if (network_delegate()->FirstPartyCookieExperimentEnabled())
636 options.set_first_party_url(request_->first_party_for_cookies());
637 else
638 options.set_include_first_party_only();
637 639
638 GetCookieStore()->GetCookiesWithOptionsAsync( 640 GetCookieStore()->GetCookiesWithOptionsAsync(
639 request_->url(), options, 641 request_->url(), options,
640 base::Bind(&URLRequestHttpJob::OnCookiesLoaded, 642 base::Bind(&URLRequestHttpJob::OnCookiesLoaded,
641 weak_factory_.GetWeakPtr())); 643 weak_factory_.GetWeakPtr()));
642 } 644 }
643 645
644 void URLRequestHttpJob::CheckCookiePolicyAndLoad( 646 void URLRequestHttpJob::CheckCookiePolicyAndLoad(
645 const CookieList& cookie_list) { 647 const CookieList& cookie_list) {
646 if (CanGetCookies(cookie_list)) 648 if (CanGetCookies(cookie_list))
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 return override_response_headers_.get() ? 1501 return override_response_headers_.get() ?
1500 override_response_headers_.get() : 1502 override_response_headers_.get() :
1501 transaction_->GetResponseInfo()->headers.get(); 1503 transaction_->GetResponseInfo()->headers.get();
1502 } 1504 }
1503 1505
1504 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1506 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1505 awaiting_callback_ = false; 1507 awaiting_callback_ = false;
1506 } 1508 }
1507 1509
1508 } // namespace net 1510 } // namespace net
OLDNEW
« chrome/browser/net/chrome_network_delegate_unittest.cc ('K') | « net/base/network_delegate_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698