OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 rights reserved. | 6 rights reserved. |
7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ | 7 Copyright (C) 2009 Torch Mobile Inc. http://www.torchmobile.com/ |
8 | 8 |
9 This library is free software; you can redistribute it and/or | 9 This library is free software; you can redistribute it and/or |
10 modify it under the terms of the GNU Library General Public | 10 modify it under the terms of the GNU Library General Public |
(...skipping 1169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1180 } | 1180 } |
1181 | 1181 |
1182 void ResourceFetcher::didFailLoading(Resource* resource, | 1182 void ResourceFetcher::didFailLoading(Resource* resource, |
1183 const ResourceError& error) { | 1183 const ResourceError& error) { |
1184 network_instrumentation::endResourceLoad( | 1184 network_instrumentation::endResourceLoad( |
1185 resource->identifier(), network_instrumentation::RequestOutcome::Fail); | 1185 resource->identifier(), network_instrumentation::RequestOutcome::Fail); |
1186 removeResourceLoader(resource->loader()); | 1186 removeResourceLoader(resource->loader()); |
1187 m_resourceTimingInfoMap.take(const_cast<Resource*>(resource)); | 1187 m_resourceTimingInfoMap.take(const_cast<Resource*>(resource)); |
1188 bool isInternalRequest = resource->options().initiatorInfo.name == | 1188 bool isInternalRequest = resource->options().initiatorInfo.name == |
1189 FetchInitiatorTypeNames::internal; | 1189 FetchInitiatorTypeNames::internal; |
1190 context().dispatchDidFail(resource->identifier(), error, isInternalRequest); | 1190 context().dispatchDidFail(resource->identifier(), error, |
| 1191 resource->response().encodedDataLength(), |
| 1192 isInternalRequest); |
1191 resource->error(error); | 1193 resource->error(error); |
1192 context().didLoadResource(resource); | 1194 context().didLoadResource(resource); |
1193 | 1195 |
1194 if (resource->isImage() && | 1196 if (resource->isImage() && |
1195 toImageResource(resource)->shouldReloadBrokenPlaceholder()) { | 1197 toImageResource(resource)->shouldReloadBrokenPlaceholder()) { |
1196 toImageResource(resource)->reloadIfLoFiOrPlaceholder(this); | 1198 toImageResource(resource)->reloadIfLoFiOrPlaceholder(this); |
1197 } | 1199 } |
1198 } | 1200 } |
1199 | 1201 |
1200 void ResourceFetcher::didReceiveResponse( | 1202 void ResourceFetcher::didReceiveResponse( |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1254 if (resource->loader() && response.httpStatusCode() >= 400 && | 1256 if (resource->loader() && response.httpStatusCode() >= 400 && |
1255 !resource->shouldIgnoreHTTPStatusCodeErrors()) { | 1257 !resource->shouldIgnoreHTTPStatusCodeErrors()) { |
1256 resource->loader()->didFail(ResourceError::cancelledError(response.url())); | 1258 resource->loader()->didFail(ResourceError::cancelledError(response.url())); |
1257 } | 1259 } |
1258 } | 1260 } |
1259 | 1261 |
1260 void ResourceFetcher::didReceiveData(const Resource* resource, | 1262 void ResourceFetcher::didReceiveData(const Resource* resource, |
1261 const char* data, | 1263 const char* data, |
1262 int dataLength, | 1264 int dataLength, |
1263 int encodedDataLength) { | 1265 int encodedDataLength) { |
1264 context().dispatchDidReceiveData(resource->identifier(), data, dataLength, | 1266 context().dispatchDidReceiveData(resource->identifier(), data, dataLength); |
1265 encodedDataLength); | 1267 context().dispatchDidReceiveEncodedData(resource->identifier(), |
| 1268 encodedDataLength); |
1266 } | 1269 } |
1267 | 1270 |
1268 void ResourceFetcher::didDownloadData(const Resource* resource, | 1271 void ResourceFetcher::didDownloadData(const Resource* resource, |
1269 int dataLength, | 1272 int dataLength, |
1270 int encodedDataLength) { | 1273 int encodedDataLength) { |
1271 context().dispatchDidDownloadData(resource->identifier(), dataLength, | 1274 context().dispatchDidDownloadData(resource->identifier(), dataLength, |
1272 encodedDataLength); | 1275 encodedDataLength); |
1273 } | 1276 } |
1274 | 1277 |
1275 void ResourceFetcher::moveResourceLoaderToNonBlocking(ResourceLoader* loader) { | 1278 void ResourceFetcher::moveResourceLoaderToNonBlocking(ResourceLoader* loader) { |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1638 visitor->trace(m_context); | 1641 visitor->trace(m_context); |
1639 visitor->trace(m_archive); | 1642 visitor->trace(m_archive); |
1640 visitor->trace(m_loaders); | 1643 visitor->trace(m_loaders); |
1641 visitor->trace(m_nonBlockingLoaders); | 1644 visitor->trace(m_nonBlockingLoaders); |
1642 visitor->trace(m_documentResources); | 1645 visitor->trace(m_documentResources); |
1643 visitor->trace(m_preloads); | 1646 visitor->trace(m_preloads); |
1644 visitor->trace(m_resourceTimingInfoMap); | 1647 visitor->trace(m_resourceTimingInfoMap); |
1645 } | 1648 } |
1646 | 1649 |
1647 } // namespace blink | 1650 } // namespace blink |
OLD | NEW |