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.h" | 5 #include "net/url_request/url_request.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
643 job_->SetPriority(priority_); | 643 job_->SetPriority(priority_); |
644 | 644 |
645 if (upload_data_stream_.get()) | 645 if (upload_data_stream_.get()) |
646 job_->SetUpload(upload_data_stream_.get()); | 646 job_->SetUpload(upload_data_stream_.get()); |
647 | 647 |
648 is_pending_ = true; | 648 is_pending_ = true; |
649 is_redirecting_ = false; | 649 is_redirecting_ = false; |
650 | 650 |
651 response_info_.was_cached = false; | 651 response_info_.was_cached = false; |
652 | 652 |
653 // If the referrer is secure, but the requested URL is not, the referrer | 653 if (GURL(referrer_) != |
654 // policy should be something non-default. If you hit this, please file a | 654 URLRequestJob::ComputeReferrerForRedirect(*this, url())) { |
mmenke
2014/11/20 16:23:45
optional nit: To make it clearer the second line
Mike West
2014/11/21 09:29:29
Done.
| |
655 // bug. | |
656 if (referrer_policy_ == | |
657 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE && | |
658 GURL(referrer_).SchemeIsSecure() && !url().SchemeIsSecure()) { | |
659 if (!network_delegate_ || | 655 if (!network_delegate_ || |
660 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader( | 656 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader( |
661 *this, url(), GURL(referrer_))) { | 657 *this, url(), GURL(referrer_))) { |
662 referrer_.clear(); | 658 referrer_.clear(); |
663 } else { | 659 } else { |
664 // We need to clear the referrer anyway to avoid an infinite recursion | 660 // We need to clear the referrer anyway to avoid an infinite recursion |
665 // when starting the error job. | 661 // when starting the error job. |
666 referrer_.clear(); | 662 referrer_.clear(); |
667 std::string source("delegate"); | 663 std::string source("delegate"); |
668 net_log_.AddEvent(NetLog::TYPE_CANCELLED, | 664 net_log_.AddEvent(NetLog::TYPE_CANCELLED, |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1229 new base::debug::StackTrace(NULL, 0); | 1225 new base::debug::StackTrace(NULL, 0); |
1230 *stack_trace_copy = stack_trace; | 1226 *stack_trace_copy = stack_trace; |
1231 stack_trace_.reset(stack_trace_copy); | 1227 stack_trace_.reset(stack_trace_copy); |
1232 } | 1228 } |
1233 | 1229 |
1234 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1230 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1235 return stack_trace_.get(); | 1231 return stack_trace_.get(); |
1236 } | 1232 } |
1237 | 1233 |
1238 } // namespace net | 1234 } // namespace net |
OLD | NEW |