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_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 995 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 redirect_info.new_referrer_policy = request_->referrer_policy(); | 1006 redirect_info.new_referrer_policy = request_->referrer_policy(); |
1007 } | 1007 } |
1008 | 1008 |
1009 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). | 1009 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). |
1010 redirect_info.new_referrer = | 1010 redirect_info.new_referrer = |
1011 ComputeReferrerForRedirect(redirect_info.new_referrer_policy, | 1011 ComputeReferrerForRedirect(redirect_info.new_referrer_policy, |
1012 request_->referrer(), redirect_info.new_url) | 1012 request_->referrer(), redirect_info.new_url) |
1013 .spec(); | 1013 .spec(); |
1014 | 1014 |
1015 std::string include_referer; | 1015 std::string include_referer; |
1016 request_->GetResponseHeaderByName("include-referer-token-binding-id", | 1016 request_->GetResponseHeaderByName("include-referred-token-binding-id", |
1017 &include_referer); | 1017 &include_referer); |
1018 if (include_referer == "true" && | 1018 if (include_referer == "true" && |
1019 request_->ssl_info().token_binding_negotiated) { | 1019 request_->ssl_info().token_binding_negotiated) { |
1020 redirect_info.referred_token_binding_host = url.host(); | 1020 redirect_info.referred_token_binding_host = url.host(); |
1021 } | 1021 } |
1022 | 1022 |
1023 return redirect_info; | 1023 return redirect_info; |
1024 } | 1024 } |
1025 | 1025 |
1026 void URLRequestJob::MaybeNotifyNetworkBytes() { | 1026 void URLRequestJob::MaybeNotifyNetworkBytes() { |
(...skipping 13 matching lines...) Expand all Loading... |
1040 int64_t total_sent_bytes = GetTotalSentBytes(); | 1040 int64_t total_sent_bytes = GetTotalSentBytes(); |
1041 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); | 1041 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); |
1042 if (total_sent_bytes > last_notified_total_sent_bytes_) { | 1042 if (total_sent_bytes > last_notified_total_sent_bytes_) { |
1043 network_delegate_->NotifyNetworkBytesSent( | 1043 network_delegate_->NotifyNetworkBytesSent( |
1044 request_, total_sent_bytes - last_notified_total_sent_bytes_); | 1044 request_, total_sent_bytes - last_notified_total_sent_bytes_); |
1045 } | 1045 } |
1046 last_notified_total_sent_bytes_ = total_sent_bytes; | 1046 last_notified_total_sent_bytes_ = total_sent_bytes; |
1047 } | 1047 } |
1048 | 1048 |
1049 } // namespace net | 1049 } // namespace net |
OLD | NEW |