| 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(); |
| 752 | 754 |
| 753 CookieStore::SetCookiesCallback callback(base::Bind( | 755 CookieStore::SetCookiesCallback callback(base::Bind( |
| 754 &URLRequestHttpJob::OnCookieSaved, weak_factory_.GetWeakPtr(), | 756 &URLRequestHttpJob::OnCookieSaved, weak_factory_.GetWeakPtr(), |
| 755 save_next_cookie_running, callback_pending)); | 757 save_next_cookie_running, callback_pending)); |
| 756 | 758 |
| 757 // Loop through the cookies as long as SetCookieWithOptionsAsync completes | 759 // Loop through the cookies as long as SetCookieWithOptionsAsync completes |
| 758 // synchronously. | 760 // synchronously. |
| 759 while (!callback_pending->data && | 761 while (!callback_pending->data && |
| 760 response_cookies_save_index_ < response_cookies_.size()) { | 762 response_cookies_save_index_ < response_cookies_.size()) { |
| 761 if (CanSetCookie( | 763 if (CanSetCookie( |
| (...skipping 813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1575 return override_response_headers_.get() ? | 1577 return override_response_headers_.get() ? |
| 1576 override_response_headers_.get() : | 1578 override_response_headers_.get() : |
| 1577 transaction_->GetResponseInfo()->headers.get(); | 1579 transaction_->GetResponseInfo()->headers.get(); |
| 1578 } | 1580 } |
| 1579 | 1581 |
| 1580 void URLRequestHttpJob::NotifyURLRequestDestroyed() { | 1582 void URLRequestHttpJob::NotifyURLRequestDestroyed() { |
| 1581 awaiting_callback_ = false; | 1583 awaiting_callback_ = false; |
| 1582 } | 1584 } |
| 1583 | 1585 |
| 1584 } // namespace net | 1586 } // namespace net |
| OLD | NEW |