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 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. | 5 // An implementation of WebURLLoader in terms of ResourceLoaderBridge. |
6 | 6 |
7 #include "webkit/glue/weburlloader_impl.h" | 7 #include "webkit/glue/weburlloader_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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 response->setURL(url); | 157 response->setURL(url); |
158 response->setResponseTime(info.response_time.ToDoubleT()); | 158 response->setResponseTime(info.response_time.ToDoubleT()); |
159 response->setMIMEType(WebString::fromUTF8(info.mime_type)); | 159 response->setMIMEType(WebString::fromUTF8(info.mime_type)); |
160 response->setTextEncodingName(WebString::fromUTF8(info.charset)); | 160 response->setTextEncodingName(WebString::fromUTF8(info.charset)); |
161 response->setExpectedContentLength(info.content_length); | 161 response->setExpectedContentLength(info.content_length); |
162 response->setSecurityInfo(info.security_info); | 162 response->setSecurityInfo(info.security_info); |
163 response->setAppCacheID(info.appcache_id); | 163 response->setAppCacheID(info.appcache_id); |
164 response->setAppCacheManifestURL(info.appcache_manifest_url); | 164 response->setAppCacheManifestURL(info.appcache_manifest_url); |
165 response->setWasCached(!info.load_timing.base_time.is_null() && | 165 response->setWasCached(!info.load_timing.base_time.is_null() && |
166 info.response_time < info.load_timing.base_time); | 166 info.response_time < info.load_timing.base_time); |
167 response->setWasFetchedViaSPDY(info.was_fetched_via_spdy); | |
168 response->setWasNpnNegotiated(info.was_npn_negotiated); | |
169 response->setWasAlternateProtocolAvailable( | |
170 info.was_alternate_protocol_available); | |
171 response->setWasFetchedViaProxy(info.was_fetched_via_proxy); | |
172 response->setRemoteIPAddress( | 167 response->setRemoteIPAddress( |
173 WebString::fromUTF8(info.socket_address.host())); | 168 WebString::fromUTF8(info.socket_address.host())); |
174 response->setRemotePort(info.socket_address.port()); | 169 response->setRemotePort(info.socket_address.port()); |
175 response->setConnectionID(info.connection_id); | 170 response->setConnectionID(info.connection_id); |
176 response->setConnectionReused(info.connection_reused); | 171 response->setConnectionReused(info.connection_reused); |
177 response->setDownloadFilePath( | 172 response->setDownloadFilePath( |
178 webkit_base::FilePathToWebString(info.download_file_path)); | 173 webkit_base::FilePathToWebString(info.download_file_path)); |
179 response->setExtraData(new WebURLResponseExtraDataImpl( | 174 WebURLResponseExtraDataImpl* extra_data = |
180 info.npn_negotiated_protocol)); | 175 new WebURLResponseExtraDataImpl(info.npn_negotiated_protocol); |
| 176 response->setExtraData(extra_data); |
| 177 extra_data->setWasFetchedViaSPDY(info.was_fetched_via_spdy); |
| 178 extra_data->setWasNpnNegotiated(info.was_npn_negotiated); |
| 179 extra_data->setWasAlternateProtocolAvailable( |
| 180 info.was_alternate_protocol_available); |
| 181 extra_data->setWasFetchedViaProxy(info.was_fetched_via_proxy); |
181 | 182 |
182 const ResourceLoadTimingInfo& timing_info = info.load_timing; | 183 const ResourceLoadTimingInfo& timing_info = info.load_timing; |
183 if (!timing_info.base_time.is_null()) { | 184 if (!timing_info.base_time.is_null()) { |
184 WebURLLoadTiming timing; | 185 WebURLLoadTiming timing; |
185 timing.initialize(); | 186 timing.initialize(); |
186 timing.setRequestTime((timing_info.base_ticks - TimeTicks()).InSecondsF()); | 187 timing.setRequestTime((timing_info.base_ticks - TimeTicks()).InSecondsF()); |
187 timing.setProxyStart(timing_info.proxy_start); | 188 timing.setProxyStart(timing_info.proxy_start); |
188 timing.setProxyEnd(timing_info.proxy_end); | 189 timing.setProxyEnd(timing_info.proxy_end); |
189 timing.setDNSStart(timing_info.dns_start); | 190 timing.setDNSStart(timing_info.dns_start); |
190 timing.setDNSEnd(timing_info.dns_end); | 191 timing.setDNSEnd(timing_info.dns_end); |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
816 | 817 |
817 void WebURLLoaderImpl::setDefersLoading(bool value) { | 818 void WebURLLoaderImpl::setDefersLoading(bool value) { |
818 context_->SetDefersLoading(value); | 819 context_->SetDefersLoading(value); |
819 } | 820 } |
820 | 821 |
821 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { | 822 void WebURLLoaderImpl::didChangePriority(WebURLRequest::Priority new_priority) { |
822 context_->DidChangePriority(new_priority); | 823 context_->DidChangePriority(new_priority); |
823 } | 824 } |
824 | 825 |
825 } // namespace webkit_glue | 826 } // namespace webkit_glue |
OLD | NEW |