| 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 956 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 967 | 967 |
| 968 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). | 968 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). |
| 969 redirect_info.new_referrer = | 969 redirect_info.new_referrer = |
| 970 ComputeReferrerForRedirect(redirect_info.new_referrer_policy, | 970 ComputeReferrerForRedirect(redirect_info.new_referrer_policy, |
| 971 request_->referrer(), redirect_info.new_url) | 971 request_->referrer(), redirect_info.new_url) |
| 972 .spec(); | 972 .spec(); |
| 973 | 973 |
| 974 std::string include_referer; | 974 std::string include_referer; |
| 975 request_->GetResponseHeaderByName("include-referred-token-binding-id", | 975 request_->GetResponseHeaderByName("include-referred-token-binding-id", |
| 976 &include_referer); | 976 &include_referer); |
| 977 include_referer = base::ToLowerASCII(include_referer); |
| 977 if (include_referer == "true" && | 978 if (include_referer == "true" && |
| 978 request_->ssl_info().token_binding_negotiated) { | 979 request_->ssl_info().token_binding_negotiated) { |
| 979 redirect_info.referred_token_binding_host = url.host(); | 980 redirect_info.referred_token_binding_host = url.host(); |
| 980 } | 981 } |
| 981 | 982 |
| 982 return redirect_info; | 983 return redirect_info; |
| 983 } | 984 } |
| 984 | 985 |
| 985 void URLRequestJob::MaybeNotifyNetworkBytes() { | 986 void URLRequestJob::MaybeNotifyNetworkBytes() { |
| 986 if (!network_delegate_) | 987 if (!network_delegate_) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 999 int64_t total_sent_bytes = GetTotalSentBytes(); | 1000 int64_t total_sent_bytes = GetTotalSentBytes(); |
| 1000 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); | 1001 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); |
| 1001 if (total_sent_bytes > last_notified_total_sent_bytes_) { | 1002 if (total_sent_bytes > last_notified_total_sent_bytes_) { |
| 1002 network_delegate_->NotifyNetworkBytesSent( | 1003 network_delegate_->NotifyNetworkBytesSent( |
| 1003 request_, total_sent_bytes - last_notified_total_sent_bytes_); | 1004 request_, total_sent_bytes - last_notified_total_sent_bytes_); |
| 1004 } | 1005 } |
| 1005 last_notified_total_sent_bytes_ = total_sent_bytes; | 1006 last_notified_total_sent_bytes_ = total_sent_bytes; |
| 1006 } | 1007 } |
| 1007 | 1008 |
| 1008 } // namespace net | 1009 } // namespace net |
| OLD | NEW |