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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
760 info.was_alternate_protocol_available); | 760 info.was_alternate_protocol_available); |
761 extra_data->set_connection_info(info.connection_info); | 761 extra_data->set_connection_info(info.connection_info); |
762 extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); | 762 extra_data->set_was_fetched_via_proxy(info.was_fetched_via_proxy); |
763 | 763 |
764 // If there's no received headers end time, don't set load timing. This is | 764 // If there's no received headers end time, don't set load timing. This is |
765 // the case for non-HTTP requests, requests that don't go over the wire, and | 765 // the case for non-HTTP requests, requests that don't go over the wire, and |
766 // certain error cases. | 766 // certain error cases. |
767 if (!info.load_timing.receive_headers_end.is_null()) { | 767 if (!info.load_timing.receive_headers_end.is_null()) { |
768 WebURLLoadTiming timing; | 768 WebURLLoadTiming timing; |
769 PopulateURLLoadTiming(info.load_timing, &timing); | 769 PopulateURLLoadTiming(info.load_timing, &timing); |
770 const TimeTicks kNullTicks; | |
771 timing.setServiceWorkerFetchStart( | |
772 (info.service_worker_fetch_start - kNullTicks).InSecondsF()); | |
773 timing.setServiceWorkerFetchReady( | |
774 (info.service_worker_fetch_ready - kNullTicks).InSecondsF()); | |
775 timing.setServiceWorkerFetchEnd( | |
776 (info.service_worker_fetch_end - kNullTicks).InSecondsF()); | |
mmenke
2014/09/04 14:53:51
+2 indent (x3)
shimazu
2014/09/05 04:18:48
Done.
| |
770 response->setLoadTiming(timing); | 777 response->setLoadTiming(timing); |
771 } | 778 } |
772 | 779 |
773 if (info.devtools_info.get()) { | 780 if (info.devtools_info.get()) { |
774 WebHTTPLoadInfo load_info; | 781 WebHTTPLoadInfo load_info; |
775 | 782 |
776 load_info.setHTTPStatusCode(info.devtools_info->http_status_code); | 783 load_info.setHTTPStatusCode(info.devtools_info->http_status_code); |
777 load_info.setHTTPStatusText(WebString::fromLatin1( | 784 load_info.setHTTPStatusText(WebString::fromLatin1( |
778 info.devtools_info->http_status_text)); | 785 info.devtools_info->http_status_text)); |
779 load_info.setEncodedDataLength(info.encoded_data_length); | 786 load_info.setEncodedDataLength(info.encoded_data_length); |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
886 int intra_priority_value) { | 893 int intra_priority_value) { |
887 context_->DidChangePriority(new_priority, intra_priority_value); | 894 context_->DidChangePriority(new_priority, intra_priority_value); |
888 } | 895 } |
889 | 896 |
890 bool WebURLLoaderImpl::attachThreadedDataReceiver( | 897 bool WebURLLoaderImpl::attachThreadedDataReceiver( |
891 blink::WebThreadedDataReceiver* threaded_data_receiver) { | 898 blink::WebThreadedDataReceiver* threaded_data_receiver) { |
892 return context_->AttachThreadedDataReceiver(threaded_data_receiver); | 899 return context_->AttachThreadedDataReceiver(threaded_data_receiver); |
893 } | 900 } |
894 | 901 |
895 } // namespace content | 902 } // namespace content |
OLD | NEW |