Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1256)

Side by Side Diff: net/url_request/url_request.cc

Issue 2485253002: Remove unnecessary calls to GURL() (Closed)
Patch Set: Fix broken tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after
635 job_->SetPriority(priority_); 635 job_->SetPriority(priority_);
636 636
637 if (upload_data_stream_.get()) 637 if (upload_data_stream_.get())
638 job_->SetUpload(upload_data_stream_.get()); 638 job_->SetUpload(upload_data_stream_.get());
639 639
640 is_pending_ = true; 640 is_pending_ = true;
641 is_redirecting_ = false; 641 is_redirecting_ = false;
642 642
643 response_info_.was_cached = false; 643 response_info_.was_cached = false;
644 644
645 if (GURL(referrer_) != URLRequestJob::ComputeReferrerForRedirect( 645 if (URLRequestJob::ComputeReferrerForRedirect(referrer_policy_, referrer_,
646 referrer_policy_, referrer_, url())) { 646 url()) != referrer_) {
esprehn 2016/11/09 21:09:25 ditto, why do we not need to canonicalize referrer
cfredric 2016/11/09 22:12:46 I had thought it was already canonicalized here. C
647 if (!network_delegate_ || 647 if (!network_delegate_ ||
648 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader( 648 !network_delegate_->CancelURLRequestWithPolicyViolatingReferrerHeader(
649 *this, url(), GURL(referrer_))) { 649 *this, url(), GURL(referrer_))) {
650 referrer_.clear(); 650 referrer_.clear();
651 } else { 651 } else {
652 // We need to clear the referrer anyway to avoid an infinite recursion 652 // We need to clear the referrer anyway to avoid an infinite recursion
653 // when starting the error job. 653 // when starting the error job.
654 referrer_.clear(); 654 referrer_.clear();
655 std::string source("delegate"); 655 std::string source("delegate");
656 net_log_.AddEvent(NetLogEventType::CANCELLED, 656 net_log_.AddEvent(NetLogEventType::CANCELLED,
(...skipping 556 matching lines...) Expand 10 before | Expand all | Expand 10 after
1213 out->clear(); 1213 out->clear();
1214 } 1214 }
1215 1215
1216 void URLRequest::set_status(URLRequestStatus status) { 1216 void URLRequest::set_status(URLRequestStatus status) {
1217 DCHECK(status_.is_io_pending() || status_.is_success() || 1217 DCHECK(status_.is_io_pending() || status_.is_success() ||
1218 (!status.is_success() && !status.is_io_pending())); 1218 (!status.is_success() && !status.is_io_pending()));
1219 status_ = status; 1219 status_ = status;
1220 } 1220 }
1221 1221
1222 } // namespace net 1222 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698