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

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

Issue 876973003: Implement the "first-party-only" cookie flag. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: FirstPartyOnly. 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
« no previous file with comments | « net/cookies/parsed_cookie_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('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 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
634 // TODO(mkwst): Pipe a switch down here to allow us to decide whether we
635 // should enforce "first-party only" cookies or not (by setting |options|'s
636 // first-party-url to the first-party-for-cookies value. crbug.com/459154
637
632 GetCookieStore()->GetCookiesWithOptionsAsync( 638 GetCookieStore()->GetCookiesWithOptionsAsync(
633 request_->url(), options, 639 request_->url(), options,
634 base::Bind(&URLRequestHttpJob::OnCookiesLoaded, 640 base::Bind(&URLRequestHttpJob::OnCookiesLoaded,
635 weak_factory_.GetWeakPtr())); 641 weak_factory_.GetWeakPtr()));
636 } 642 }
637 643
638 void URLRequestHttpJob::CheckCookiePolicyAndLoad( 644 void URLRequestHttpJob::CheckCookiePolicyAndLoad(
639 const CookieList& cookie_list) { 645 const CookieList& cookie_list) {
640 if (CanGetCookies(cookie_list)) 646 if (CanGetCookies(cookie_list))
641 DoLoadCookies(); 647 DoLoadCookies();
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 return override_response_headers_.get() ? 1505 return override_response_headers_.get() ?
1500 override_response_headers_.get() : 1506 override_response_headers_.get() :
1501 transaction_->GetResponseInfo()->headers.get(); 1507 transaction_->GetResponseInfo()->headers.get();
1502 } 1508 }
1503 1509
1504 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1510 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1505 awaiting_callback_ = false; 1511 awaiting_callback_ = false;
1506 } 1512 }
1507 1513
1508 } // namespace net 1514 } // namespace net
OLDNEW
« no previous file with comments | « net/cookies/parsed_cookie_unittest.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698