| 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 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 868 load_timing_info_ = LoadTimingInfo(); | 868 load_timing_info_ = LoadTimingInfo(); |
| 869 load_timing_info_.request_start_time = response_info_.request_time; | 869 load_timing_info_.request_start_time = response_info_.request_time; |
| 870 load_timing_info_.request_start = base::TimeTicks::Now(); | 870 load_timing_info_.request_start = base::TimeTicks::Now(); |
| 871 | 871 |
| 872 status_ = URLRequestStatus(); | 872 status_ = URLRequestStatus(); |
| 873 is_pending_ = false; | 873 is_pending_ = false; |
| 874 proxy_server_ = HostPortPair(); | 874 proxy_server_ = HostPortPair(); |
| 875 } | 875 } |
| 876 | 876 |
| 877 void URLRequest::OrphanJob() { | 877 void URLRequest::OrphanJob() { |
| 878 if (network_delegate_) |
| 879 network_delegate_->NotifyURLRequestJobOrphaned(this); |
| 880 |
| 878 // When calling this function, please check that URLRequestHttpJob is | 881 // When calling this function, please check that URLRequestHttpJob is |
| 879 // not in between calling NetworkDelegate::NotifyHeadersReceived receiving | 882 // not in between calling NetworkDelegate::NotifyHeadersReceived receiving |
| 880 // the call back. This is currently guaranteed by the following strategies: | 883 // the call back. This is currently guaranteed by the following strategies: |
| 881 // - OrphanJob is called on JobRestart, in this case the URLRequestJob cannot | 884 // - OrphanJob is called on JobRestart, in this case the URLRequestJob cannot |
| 882 // be receiving any headers at that time. | 885 // be receiving any headers at that time. |
| 883 // - OrphanJob is called in ~URLRequest, in this case | 886 // - OrphanJob is called in ~URLRequest, in this case |
| 884 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate | 887 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate |
| 885 // that the callback becomes invalid. | 888 // that the callback becomes invalid. |
| 886 job_->Kill(); | 889 job_->Kill(); |
| 887 job_->DetachRequest(); // ensures that the job will not call us again | 890 job_->DetachRequest(); // ensures that the job will not call us again |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1186 } | 1189 } |
| 1187 | 1190 |
| 1188 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { | 1191 void URLRequest::GetConnectionAttempts(ConnectionAttempts* out) const { |
| 1189 if (job_) | 1192 if (job_) |
| 1190 job_->GetConnectionAttempts(out); | 1193 job_->GetConnectionAttempts(out); |
| 1191 else | 1194 else |
| 1192 out->clear(); | 1195 out->clear(); |
| 1193 } | 1196 } |
| 1194 | 1197 |
| 1195 } // namespace net | 1198 } // namespace net |
| OLD | NEW |