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

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

Issue 2337253004: Update Token Binding code to the latest drafts (Closed)
Patch Set: Fix compilation error in unit_tests Created 4 years, 3 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
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_job.h" 5 #include "net/url_request/url_request_job.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
(...skipping 960 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 971
972 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). 972 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS).
973 redirect_info.new_referrer = 973 redirect_info.new_referrer =
974 ComputeReferrerForRedirect(redirect_info.new_referrer_policy, 974 ComputeReferrerForRedirect(redirect_info.new_referrer_policy,
975 request_->referrer(), redirect_info.new_url) 975 request_->referrer(), redirect_info.new_url)
976 .spec(); 976 .spec();
977 977
978 std::string include_referer; 978 std::string include_referer;
979 request_->GetResponseHeaderByName("include-referred-token-binding-id", 979 request_->GetResponseHeaderByName("include-referred-token-binding-id",
980 &include_referer); 980 &include_referer);
981 include_referer = base::ToLowerASCII(include_referer);
981 if (include_referer == "true" && 982 if (include_referer == "true" &&
982 request_->ssl_info().token_binding_negotiated) { 983 request_->ssl_info().token_binding_negotiated) {
983 redirect_info.referred_token_binding_host = url.host(); 984 redirect_info.referred_token_binding_host = url.host();
984 } 985 }
985 986
986 return redirect_info; 987 return redirect_info;
987 } 988 }
988 989
989 void URLRequestJob::MaybeNotifyNetworkBytes() { 990 void URLRequestJob::MaybeNotifyNetworkBytes() {
990 if (!network_delegate_) 991 if (!network_delegate_)
(...skipping 12 matching lines...) Expand all
1003 int64_t total_sent_bytes = GetTotalSentBytes(); 1004 int64_t total_sent_bytes = GetTotalSentBytes();
1004 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); 1005 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_);
1005 if (total_sent_bytes > last_notified_total_sent_bytes_) { 1006 if (total_sent_bytes > last_notified_total_sent_bytes_) {
1006 network_delegate_->NotifyNetworkBytesSent( 1007 network_delegate_->NotifyNetworkBytesSent(
1007 request_, total_sent_bytes - last_notified_total_sent_bytes_); 1008 request_, total_sent_bytes - last_notified_total_sent_bytes_);
1008 } 1009 }
1009 last_notified_total_sent_bytes_ = total_sent_bytes; 1010 last_notified_total_sent_bytes_ = total_sent_bytes;
1010 } 1011 }
1011 1012
1012 } // namespace net 1013 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698