| 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 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 this, network_delegate_, redirect_info.new_url); | 811 this, network_delegate_, redirect_info.new_url); |
| 812 if (job) { | 812 if (job) { |
| 813 RestartWithJob(job); | 813 RestartWithJob(job); |
| 814 } else { | 814 } else { |
| 815 OnCallToDelegate(); | 815 OnCallToDelegate(); |
| 816 delegate_->OnReceivedRedirect(this, redirect_info, defer_redirect); | 816 delegate_->OnReceivedRedirect(this, redirect_info, defer_redirect); |
| 817 // |this| may be have been destroyed here. | 817 // |this| may be have been destroyed here. |
| 818 } | 818 } |
| 819 } | 819 } |
| 820 | 820 |
| 821 void URLRequest::ResumeNetworkStart() { | |
| 822 DCHECK(job_.get()); | |
| 823 | |
| 824 OnCallToDelegateComplete(); | |
| 825 job_->ResumeNetworkStart(); | |
| 826 } | |
| 827 | |
| 828 void URLRequest::NotifyResponseStarted(const URLRequestStatus& status) { | 821 void URLRequest::NotifyResponseStarted(const URLRequestStatus& status) { |
| 829 // Change status if there was an error. | 822 // Change status if there was an error. |
| 830 if (status.status() != URLRequestStatus::SUCCESS) | 823 if (status.status() != URLRequestStatus::SUCCESS) |
| 831 set_status(status); | 824 set_status(status); |
| 832 | 825 |
| 833 int net_error = OK; | 826 int net_error = OK; |
| 834 if (!status_.is_success()) | 827 if (!status_.is_success()) |
| 835 net_error = status_.error(); | 828 net_error = status_.error(); |
| 836 net_log_.EndEventWithNetErrorCode(NetLogEventType::URL_REQUEST_START_JOB, | 829 net_log_.EndEventWithNetErrorCode(NetLogEventType::URL_REQUEST_START_JOB, |
| 837 net_error); | 830 net_error); |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1240 out->clear(); | 1233 out->clear(); |
| 1241 } | 1234 } |
| 1242 | 1235 |
| 1243 void URLRequest::set_status(URLRequestStatus status) { | 1236 void URLRequest::set_status(URLRequestStatus status) { |
| 1244 DCHECK(status_.is_io_pending() || status_.is_success() || | 1237 DCHECK(status_.is_io_pending() || status_.is_success() || |
| 1245 (!status.is_success() && !status.is_io_pending())); | 1238 (!status.is_success() && !status.is_io_pending())); |
| 1246 status_ = status; | 1239 status_ = status; |
| 1247 } | 1240 } |
| 1248 | 1241 |
| 1249 } // namespace net | 1242 } // namespace net |
| OLD | NEW |