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 635 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 the referrer is secure, but the requested URL is not, the referrer |
654 // policy should be something non-default. If you hit this, please file a | 654 // policy should be something non-default. If you hit this, please file a |
655 // bug. | 655 // bug. |
656 if (referrer_policy_ == | 656 if ((referrer_policy_ == |
657 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE && | 657 CLEAR_REFERRER_ON_TRANSITION_FROM_SECURE_TO_INSECURE || |
658 referrer_policy_ == | |
659 REDUCE_REFERRER_GRANULARITY_ON_TRANSITION_CROSS_ORIGIN) && | |
jochen (gone - plz use gerrit)
2014/11/19 10:03:48
you could also check that for the "REDUCE_.*" case
Mike West
2014/11/19 10:23:08
This got a bit complex. Still make sense?
| |
658 GURL(referrer_).SchemeIsSecure() && !url().SchemeIsSecure()) { | 660 GURL(referrer_).SchemeIsSecure() && !url().SchemeIsSecure()) { |
659 if (!network_delegate_ || | 661 if (!network_delegate_ || |
660 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader( | 662 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader( |
661 *this, url(), GURL(referrer_))) { | 663 *this, url(), GURL(referrer_))) { |
662 referrer_.clear(); | 664 referrer_.clear(); |
663 } else { | 665 } else { |
664 // We need to clear the referrer anyway to avoid an infinite recursion | 666 // We need to clear the referrer anyway to avoid an infinite recursion |
665 // when starting the error job. | 667 // when starting the error job. |
666 referrer_.clear(); | 668 referrer_.clear(); |
667 std::string source("delegate"); | 669 std::string source("delegate"); |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1229 new base::debug::StackTrace(NULL, 0); | 1231 new base::debug::StackTrace(NULL, 0); |
1230 *stack_trace_copy = stack_trace; | 1232 *stack_trace_copy = stack_trace; |
1231 stack_trace_.reset(stack_trace_copy); | 1233 stack_trace_.reset(stack_trace_copy); |
1232 } | 1234 } |
1233 | 1235 |
1234 const base::debug::StackTrace* URLRequest::stack_trace() const { | 1236 const base::debug::StackTrace* URLRequest::stack_trace() const { |
1235 return stack_trace_.get(); | 1237 return stack_trace_.get(); |
1236 } | 1238 } |
1237 | 1239 |
1238 } // namespace net | 1240 } // namespace net |
OLD | NEW |