OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |