Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(199)

Side by Side Diff: net/url_request/url_request_http_job.cc

Issue 1393193005: Implement $Secure- cookie prefix (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: test fix Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/cookies/cookie_store_unittest.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())
droger 2015/12/01 13:10:23 Is it supported to have a null delegate? I see tha
mmenke 2015/12/01 15:55:53 Hrm...we generally allow a NULL delegate. The fac
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
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
OLDNEW
« no previous file with comments | « net/cookies/cookie_store_unittest.h ('k') | net/url_request/url_request_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698