| 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 <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 630 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 641 | 641 |
| 642 if (upload_data_stream_.get()) | 642 if (upload_data_stream_.get()) |
| 643 job_->SetUpload(upload_data_stream_.get()); | 643 job_->SetUpload(upload_data_stream_.get()); |
| 644 | 644 |
| 645 is_pending_ = true; | 645 is_pending_ = true; |
| 646 is_redirecting_ = false; | 646 is_redirecting_ = false; |
| 647 | 647 |
| 648 response_info_.was_cached = false; | 648 response_info_.was_cached = false; |
| 649 | 649 |
| 650 GURL referrer_url(referrer_); | 650 GURL referrer_url(referrer_); |
| 651 if (referrer_url != URLRequestJob::ComputeReferrerForRedirect( | 651 if (referrer_url != URLRequestJob::ComputeReferrerForPolicy( |
| 652 referrer_policy_, referrer_url, url())) { | 652 referrer_policy_, referrer_url, url())) { |
| 653 if (!network_delegate_ || | 653 if (!network_delegate_ || |
| 654 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader( | 654 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader( |
| 655 *this, url(), referrer_url)) { | 655 *this, url(), referrer_url)) { |
| 656 referrer_.clear(); | 656 referrer_.clear(); |
| 657 } else { | 657 } else { |
| 658 // We need to clear the referrer anyway to avoid an infinite recursion | 658 // We need to clear the referrer anyway to avoid an infinite recursion |
| 659 // when starting the error job. | 659 // when starting the error job. |
| 660 referrer_.clear(); | 660 referrer_.clear(); |
| 661 std::string source("delegate"); | 661 std::string source("delegate"); |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 out->clear(); | 1206 out->clear(); |
| 1207 } | 1207 } |
| 1208 | 1208 |
| 1209 void URLRequest::set_status(URLRequestStatus status) { | 1209 void URLRequest::set_status(URLRequestStatus status) { |
| 1210 DCHECK(status_.is_io_pending() || status_.is_success() || | 1210 DCHECK(status_.is_io_pending() || status_.is_success() || |
| 1211 (!status.is_success() && !status.is_io_pending())); | 1211 (!status.is_success() && !status.is_io_pending())); |
| 1212 status_ = status; | 1212 status_ = status; |
| 1213 } | 1213 } |
| 1214 | 1214 |
| 1215 } // namespace net | 1215 } // namespace net |
| OLD | NEW |