| 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 837 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 848 } | 848 } |
| 849 | 849 |
| 850 void URLRequest::FollowDeferredRedirect() { | 850 void URLRequest::FollowDeferredRedirect() { |
| 851 DCHECK(job_.get()); | 851 DCHECK(job_.get()); |
| 852 DCHECK(status_.is_success()); | 852 DCHECK(status_.is_success()); |
| 853 | 853 |
| 854 status_ = URLRequestStatus::FromError(ERR_IO_PENDING); | 854 status_ = URLRequestStatus::FromError(ERR_IO_PENDING); |
| 855 job_->FollowDeferredRedirect(); | 855 job_->FollowDeferredRedirect(); |
| 856 } | 856 } |
| 857 | 857 |
| 858 const GURL& URLRequest::GetDeferredRedirectUrl() { |
| 859 DCHECK(job_.get()); |
| 860 DCHECK(status_.is_success()); |
| 861 DCHECK(is_redirecting_); |
| 862 |
| 863 return job_->deferred_redirect_info().new_url; |
| 864 } |
| 865 |
| 858 void URLRequest::SetAuth(const AuthCredentials& credentials) { | 866 void URLRequest::SetAuth(const AuthCredentials& credentials) { |
| 859 DCHECK(job_.get()); | 867 DCHECK(job_.get()); |
| 860 DCHECK(job_->NeedsAuth()); | 868 DCHECK(job_->NeedsAuth()); |
| 861 | 869 |
| 862 status_ = URLRequestStatus::FromError(ERR_IO_PENDING); | 870 status_ = URLRequestStatus::FromError(ERR_IO_PENDING); |
| 863 job_->SetAuth(credentials); | 871 job_->SetAuth(credentials); |
| 864 } | 872 } |
| 865 | 873 |
| 866 void URLRequest::CancelAuth() { | 874 void URLRequest::CancelAuth() { |
| 867 DCHECK(job_.get()); | 875 DCHECK(job_.get()); |
| (...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1214 out->clear(); | 1222 out->clear(); |
| 1215 } | 1223 } |
| 1216 | 1224 |
| 1217 void URLRequest::set_status(URLRequestStatus status) { | 1225 void URLRequest::set_status(URLRequestStatus status) { |
| 1218 DCHECK(status_.is_io_pending() || status_.is_success() || | 1226 DCHECK(status_.is_io_pending() || status_.is_success() || |
| 1219 (!status.is_success() && !status.is_io_pending())); | 1227 (!status.is_success() && !status.is_io_pending())); |
| 1220 status_ = status; | 1228 status_ = status; |
| 1221 } | 1229 } |
| 1222 | 1230 |
| 1223 } // namespace net | 1231 } // namespace net |
| OLD | NEW |