| 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 937 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 948 | 948 |
| 949 // Update the first-party URL if appropriate. | 949 // Update the first-party URL if appropriate. |
| 950 if (request_->first_party_url_policy() == | 950 if (request_->first_party_url_policy() == |
| 951 URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT) { | 951 URLRequest::UPDATE_FIRST_PARTY_URL_ON_REDIRECT) { |
| 952 redirect_info.new_first_party_for_cookies = redirect_info.new_url; | 952 redirect_info.new_first_party_for_cookies = redirect_info.new_url; |
| 953 } else { | 953 } else { |
| 954 redirect_info.new_first_party_for_cookies = | 954 redirect_info.new_first_party_for_cookies = |
| 955 request_->first_party_for_cookies(); | 955 request_->first_party_for_cookies(); |
| 956 } | 956 } |
| 957 | 957 |
| 958 if (request_->context()->enable_referrer_policy_header()) { | 958 redirect_info.new_referrer_policy = |
| 959 redirect_info.new_referrer_policy = | 959 ProcessReferrerPolicyHeaderOnRedirect(request_); |
| 960 ProcessReferrerPolicyHeaderOnRedirect(request_); | |
| 961 } else { | |
| 962 redirect_info.new_referrer_policy = request_->referrer_policy(); | |
| 963 } | |
| 964 | 960 |
| 965 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). | 961 // Alter the referrer if redirecting cross-origin (especially HTTP->HTTPS). |
| 966 redirect_info.new_referrer = | 962 redirect_info.new_referrer = |
| 967 ComputeReferrerForRedirect(redirect_info.new_referrer_policy, | 963 ComputeReferrerForRedirect(redirect_info.new_referrer_policy, |
| 968 request_->referrer(), redirect_info.new_url) | 964 request_->referrer(), redirect_info.new_url) |
| 969 .spec(); | 965 .spec(); |
| 970 | 966 |
| 971 std::string include_referer; | 967 std::string include_referer; |
| 972 request_->GetResponseHeaderByName("include-referred-token-binding-id", | 968 request_->GetResponseHeaderByName("include-referred-token-binding-id", |
| 973 &include_referer); | 969 &include_referer); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 997 int64_t total_sent_bytes = GetTotalSentBytes(); | 993 int64_t total_sent_bytes = GetTotalSentBytes(); |
| 998 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); | 994 DCHECK_GE(total_sent_bytes, last_notified_total_sent_bytes_); |
| 999 if (total_sent_bytes > last_notified_total_sent_bytes_) { | 995 if (total_sent_bytes > last_notified_total_sent_bytes_) { |
| 1000 network_delegate_->NotifyNetworkBytesSent( | 996 network_delegate_->NotifyNetworkBytesSent( |
| 1001 request_, total_sent_bytes - last_notified_total_sent_bytes_); | 997 request_, total_sent_bytes - last_notified_total_sent_bytes_); |
| 1002 } | 998 } |
| 1003 last_notified_total_sent_bytes_ = total_sent_bytes; | 999 last_notified_total_sent_bytes_ = total_sent_bytes; |
| 1004 } | 1000 } |
| 1005 | 1001 |
| 1006 } // namespace net | 1002 } // namespace net |
| OLD | NEW |