| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
| 6 | 6 |
| 7 #include "content/child/web_url_loader_impl.h" | 7 #include "content/child/web_url_loader_impl.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 info.was_alternate_protocol_available); | 770 info.was_alternate_protocol_available); |
| 771 extra_data->set_connection_info(info.connection_info); | 771 extra_data->set_connection_info(info.connection_info); |
| 772 extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); | 772 extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); |
| 773 | 773 |
| 774 // If there's no received headers end time, don't set load timing. This is | 774 // If there's no received headers end time, don't set load timing. This is |
| 775 // the case for non-HTTP requests, requests that don't go over the wire, and | 775 // the case for non-HTTP requests, requests that don't go over the wire, and |
| 776 // certain error cases. | 776 // certain error cases. |
| 777 if (!info.load_timing.receive_headers_end.is_null()) { | 777 if (!info.load_timing.receive_headers_end.is_null()) { |
| 778 WebURLLoadTiming timing; | 778 WebURLLoadTiming timing; |
| 779 PopulateURLLoadTiming(info.load_timing, &timing); | 779 PopulateURLLoadTiming(info.load_timing, &timing); |
| 780 const TimeTicks kNullTicks; |
| 781 timing.setServiceWorkerFetchStart( |
| 782 (info.service_worker_fetch_start - kNullTicks).InSecondsF()); |
| 783 timing.setServiceWorkerFetchReady( |
| 784 (info.service_worker_fetch_ready - kNullTicks).InSecondsF()); |
| 785 timing.setServiceWorkerFetchEnd( |
| 786 (info.service_worker_fetch_end - kNullTicks).InSecondsF()); |
| 780 response->setLoadTiming(timing); | 787 response->setLoadTiming(timing); |
| 781 } | 788 } |
| 782 | 789 |
| 783 if (info.devtools_info.get()) { | 790 if (info.devtools_info.get()) { |
| 784 WebHTTPLoadInfo load_info; | 791 WebHTTPLoadInfo load_info; |
| 785 | 792 |
| 786 load_info.setHTTPStatusCode(info.devtools_info->http_status_code); | 793 load_info.setHTTPStatusCode(info.devtools_info->http_status_code); |
| 787 load_info.setHTTPStatusText(WebString::fromLatin1( | 794 load_info.setHTTPStatusText(WebString::fromLatin1( |
| 788 info.devtools_info->http_status_text)); | 795 info.devtools_info->http_status_text)); |
| 789 load_info.setEncodedDataLength(info.encoded_data_length); | 796 load_info.setEncodedDataLength(info.encoded_data_length); |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 896 int intra_priority_value) { | 903 int intra_priority_value) { |
| 897 context_->DidChangePriority(new_priority, intra_priority_value); | 904 context_->DidChangePriority(new_priority, intra_priority_value); |
| 898 } | 905 } |
| 899 | 906 |
| 900 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 907 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
| 901 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 908 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
| 902 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 909 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
| 903 } | 910 } |
| 904 | 911 |
| 905 } // namespace content | 912 } // namespace content |
| OLD | NEW |