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 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "net/ssl/ssl_config_service.h" | 44 #include "net/ssl/ssl_config_service.h" |
45 #include "net/url_request/http_user_agent_settings.h" | 45 #include "net/url_request/http_user_agent_settings.h" |
46 #include "net/url_request/url_request.h" | 46 #include "net/url_request/url_request.h" |
47 #include "net/url_request/url_request_backoff_manager.h" | 47 #include "net/url_request/url_request_backoff_manager.h" |
48 #include "net/url_request/url_request_context.h" | 48 #include "net/url_request/url_request_context.h" |
49 #include "net/url_request/url_request_error_job.h" | 49 #include "net/url_request/url_request_error_job.h" |
50 #include "net/url_request/url_request_job_factory.h" | 50 #include "net/url_request/url_request_job_factory.h" |
51 #include "net/url_request/url_request_redirect_job.h" | 51 #include "net/url_request/url_request_redirect_job.h" |
52 #include "net/url_request/url_request_throttler_manager.h" | 52 #include "net/url_request/url_request_throttler_manager.h" |
53 #include "net/websockets/websocket_handshake_stream_base.h" | 53 #include "net/websockets/websocket_handshake_stream_base.h" |
| 54 #include "url/origin.h" |
54 | 55 |
55 static const char kAvailDictionaryHeader[] = "Avail-Dictionary"; | 56 static const char kAvailDictionaryHeader[] = "Avail-Dictionary"; |
56 | 57 |
57 namespace net { | 58 namespace net { |
58 | 59 |
59 class URLRequestHttpJob::HttpFilterContext : public FilterContext { | 60 class URLRequestHttpJob::HttpFilterContext : public FilterContext { |
60 public: | 61 public: |
61 explicit HttpFilterContext(URLRequestHttpJob* job); | 62 explicit HttpFilterContext(URLRequestHttpJob* job); |
62 ~HttpFilterContext() override; | 63 ~HttpFilterContext() override; |
63 | 64 |
(...skipping 591 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 } | 656 } |
656 | 657 |
657 void URLRequestHttpJob::DoLoadCookies() { | 658 void URLRequestHttpJob::DoLoadCookies() { |
658 CookieOptions options; | 659 CookieOptions options; |
659 options.set_include_httponly(); | 660 options.set_include_httponly(); |
660 | 661 |
661 // TODO(mkwst): Drop this `if` once we decide whether or not to ship | 662 // TODO(mkwst): Drop this `if` once we decide whether or not to ship |
662 // first-party cookies: https://crbug.com/459154 | 663 // first-party cookies: https://crbug.com/459154 |
663 if (network_delegate() && | 664 if (network_delegate() && |
664 network_delegate()->AreExperimentalCookieFeaturesEnabled()) | 665 network_delegate()->AreExperimentalCookieFeaturesEnabled()) |
665 options.set_first_party_url(request_->first_party_for_cookies()); | 666 options.set_first_party(url::Origin(request_->first_party_for_cookies())); |
666 else | 667 else |
667 options.set_include_first_party_only(); | 668 options.set_include_first_party_only(); |
668 | 669 |
669 request_->context()->cookie_store()->GetCookiesWithOptionsAsync( | 670 request_->context()->cookie_store()->GetCookiesWithOptionsAsync( |
670 request_->url(), options, base::Bind(&URLRequestHttpJob::OnCookiesLoaded, | 671 request_->url(), options, base::Bind(&URLRequestHttpJob::OnCookiesLoaded, |
671 weak_factory_.GetWeakPtr())); | 672 weak_factory_.GetWeakPtr())); |
672 } | 673 } |
673 | 674 |
674 void URLRequestHttpJob::CheckCookiePolicyAndLoad( | 675 void URLRequestHttpJob::CheckCookiePolicyAndLoad( |
675 const CookieList& cookie_list) { | 676 const CookieList& cookie_list) { |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1577 return override_response_headers_.get() ? | 1578 return override_response_headers_.get() ? |
1578 override_response_headers_.get() : | 1579 override_response_headers_.get() : |
1579 transaction_->GetResponseInfo()->headers.get(); | 1580 transaction_->GetResponseInfo()->headers.get(); |
1580 } | 1581 } |
1581 | 1582 |
1582 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1583 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
1583 awaiting_callback_ = false; | 1584 awaiting_callback_ = false; |
1584 } | 1585 } |
1585 | 1586 |
1586 } // namespace net | 1587 } // namespace net |
OLD | NEW |