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

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: Tiny bug. 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
633 // TODO(mkwst): Pipe a switch down here to allow us to decide whether we
634 // should enforce "first-party" cookies or not (by setting |options|'s
635 // first-party-url to the first-party-for-cookies value. crbug.com/459154
mmenke 2015/02/19 21:04:35 So we already have URLRequest::FirstPartyURLPolicy
636
632 GetCookieStore()->GetCookiesWithOptionsAsync( 637 GetCookieStore()->GetCookiesWithOptionsAsync(
633 request_->url(), options, 638 request_->url(), options,
634 base::Bind(&URLRequestHttpJob::OnCookiesLoaded, 639 base::Bind(&URLRequestHttpJob::OnCookiesLoaded,
635 weak_factory_.GetWeakPtr())); 640 weak_factory_.GetWeakPtr()));
636 } 641 }
637 642
638 void URLRequestHttpJob::CheckCookiePolicyAndLoad( 643 void URLRequestHttpJob::CheckCookiePolicyAndLoad(
639 const CookieList& cookie_list) { 644 const CookieList& cookie_list) {
640 if (CanGetCookies(cookie_list)) 645 if (CanGetCookies(cookie_list))
641 DoLoadCookies(); 646 DoLoadCookies();
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1499 return override_response_headers_.get() ? 1504 return override_response_headers_.get() ?
1500 override_response_headers_.get() : 1505 override_response_headers_.get() :
1501 transaction_->GetResponseInfo()->headers.get(); 1506 transaction_->GetResponseInfo()->headers.get();
1502 } 1507 }
1503 1508
1504 void URLRequestHttpJob::NotifyURLRequestDestroyed() { 1509 void URLRequestHttpJob::NotifyURLRequestDestroyed() {
1505 awaiting_callback_ = false; 1510 awaiting_callback_ = false;
1506 } 1511 }
1507 1512
1508 } // namespace net 1513 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698