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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 | 911 |
912 response_info_ = HttpResponseInfo(); | 912 response_info_ = HttpResponseInfo(); |
913 response_info_.request_time = base::Time::Now(); | 913 response_info_.request_time = base::Time::Now(); |
914 | 914 |
915 load_timing_info_ = LoadTimingInfo(); | 915 load_timing_info_ = LoadTimingInfo(); |
916 load_timing_info_.request_start_time = response_info_.request_time; | 916 load_timing_info_.request_start_time = response_info_.request_time; |
917 load_timing_info_.request_start = base::TimeTicks::Now(); | 917 load_timing_info_.request_start = base::TimeTicks::Now(); |
918 | 918 |
919 status_ = URLRequestStatus(); | 919 status_ = URLRequestStatus(); |
920 is_pending_ = false; | 920 is_pending_ = false; |
921 proxy_server_ = HostPortPair(); | 921 proxy_server_ = ProxyServer(); |
922 } | 922 } |
923 | 923 |
924 void URLRequest::OrphanJob() { | 924 void URLRequest::OrphanJob() { |
925 // When calling this function, please check that URLRequestHttpJob is | 925 // When calling this function, please check that URLRequestHttpJob is |
926 // not in between calling NetworkDelegate::NotifyHeadersReceived receiving | 926 // not in between calling NetworkDelegate::NotifyHeadersReceived receiving |
927 // the call back. This is currently guaranteed by the following strategies: | 927 // the call back. This is currently guaranteed by the following strategies: |
928 // - OrphanJob is called on JobRestart, in this case the URLRequestJob cannot | 928 // - OrphanJob is called on JobRestart, in this case the URLRequestJob cannot |
929 // be receiving any headers at that time. | 929 // be receiving any headers at that time. |
930 // - OrphanJob is called in ~URLRequest, in this case | 930 // - OrphanJob is called in ~URLRequest, in this case |
931 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate | 931 // NetworkDelegate::NotifyURLRequestDestroyed notifies the NetworkDelegate |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1235 out->clear(); | 1235 out->clear(); |
1236 } | 1236 } |
1237 | 1237 |
1238 void URLRequest::set_status(URLRequestStatus status) { | 1238 void URLRequest::set_status(URLRequestStatus status) { |
1239 DCHECK(status_.is_io_pending() || status_.is_success() || | 1239 DCHECK(status_.is_io_pending() || status_.is_success() || |
1240 (!status.is_success() && !status.is_io_pending())); | 1240 (!status.is_success() && !status.is_io_pending())); |
1241 status_ = status; | 1241 status_ = status; |
1242 } | 1242 } |
1243 | 1243 |
1244 } // namespace net | 1244 } // namespace net |
OLD | NEW |