| 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 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 742 // OnCookieSaved. | 742 // OnCookieSaved. |
| 743 scoped_refptr<SharedBoolean> callback_pending = new SharedBoolean(false); | 743 scoped_refptr<SharedBoolean> callback_pending = new SharedBoolean(false); |
| 744 scoped_refptr<SharedBoolean> save_next_cookie_running = | 744 scoped_refptr<SharedBoolean> save_next_cookie_running = |
| 745 new SharedBoolean(true); | 745 new SharedBoolean(true); |
| 746 | 746 |
| 747 if (!(request_info_.load_flags & LOAD_DO_NOT_SAVE_COOKIES) && | 747 if (!(request_info_.load_flags & LOAD_DO_NOT_SAVE_COOKIES) && |
| 748 request_->context()->cookie_store() && response_cookies_.size() > 0) { | 748 request_->context()->cookie_store() && response_cookies_.size() > 0) { |
| 749 CookieOptions options; | 749 CookieOptions options; |
| 750 options.set_include_httponly(); | 750 options.set_include_httponly(); |
| 751 options.set_server_time(response_date_); | 751 options.set_server_time(response_date_); |
| 752 if (network_delegate()->AreExperimentalCookieFeaturesEnabled()) | |
| 753 options.set_enforce_prefixes(); | |
| 754 | 752 |
| 755 CookieStore::SetCookiesCallback callback(base::Bind( | 753 CookieStore::SetCookiesCallback callback(base::Bind( |
| 756 &URLRequestHttpJob::OnCookieSaved, weak_factory_.GetWeakPtr(), | 754 &URLRequestHttpJob::OnCookieSaved, weak_factory_.GetWeakPtr(), |
| 757 save_next_cookie_running, callback_pending)); | 755 save_next_cookie_running, callback_pending)); |
| 758 | 756 |
| 759 // Loop through the cookies as long as SetCookieWithOptionsAsync completes | 757 // Loop through the cookies as long as SetCookieWithOptionsAsync completes |
| 760 // synchronously. | 758 // synchronously. |
| 761 while (!callback_pending->data && | 759 while (!callback_pending->data && |
| 762 response_cookies_save_index_ < response_cookies_.size()) { | 760 response_cookies_save_index_ < response_cookies_.size()) { |
| 763 if (CanSetCookie( | 761 if (CanSetCookie( |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1577 return override_response_headers_.get() ? | 1575 return override_response_headers_.get() ? |
| 1578 override_response_headers_.get() : | 1576 override_response_headers_.get() : |
| 1579 transaction_->GetResponseInfo()->headers.get(); | 1577 transaction_->GetResponseInfo()->headers.get(); |
| 1580 } | 1578 } |
| 1581 | 1579 |
| 1582 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1580 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1583 awaiting_callback_ = false; | 1581 awaiting_callback_ = false; |
| 1584 } | 1582 } |
| 1585 | 1583 |
| 1586 } // namespace net | 1584 } // namespace net |
| OLD | NEW |