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 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 | 632 |
633 // 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 |
634 // should enforce "first-party" cookies or not (by setting |options|'s | 634 // first-party cookies: https://crbug.com/459154 |
635 // 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()); | |
mmenke
2015/02/20 16:30:39
As-is, these lines could be removed, or always set
mmenke
2015/02/20 16:30:39
Ahh...This makes sense. I hadn't realized it was
| |
637 else | |
638 options.set_include_all_first_party(); | |
636 | 639 |
637 GetCookieStore()->GetCookiesWithOptionsAsync( | 640 GetCookieStore()->GetCookiesWithOptionsAsync( |
638 request_->url(), options, | 641 request_->url(), options, |
639 base::Bind(&URLRequestHttpJob::OnCookiesLoaded, | 642 base::Bind(&URLRequestHttpJob::OnCookiesLoaded, |
640 weak_factory_.GetWeakPtr())); | 643 weak_factory_.GetWeakPtr())); |
641 } | 644 } |
642 | 645 |
643 void URLRequestHttpJob::CheckCookiePolicyAndLoad( | 646 void URLRequestHttpJob::CheckCookiePolicyAndLoad( |
644 const CookieList& cookie_list) { | 647 const CookieList& cookie_list) { |
645 if (CanGetCookies(cookie_list)) | 648 if (CanGetCookies(cookie_list)) |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1504 return override_response_headers_.get() ? | 1507 return override_response_headers_.get() ? |
1505 override_response_headers_.get() : | 1508 override_response_headers_.get() : |
1506 transaction_->GetResponseInfo()->headers.get(); | 1509 transaction_->GetResponseInfo()->headers.get(); |
1507 } | 1510 } |
1508 | 1511 |
1509 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1512 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1510 awaiting_callback_ = false; | 1513 awaiting_callback_ = false; |
1511 } | 1514 } |
1512 | 1515 |
1513 } // namespace net | 1516 } // namespace net |
OLD | NEW |