Changeset 20178 in webkit
- Timestamp:
- Mar 13, 2007, 8:59:08 PM (18 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r20177 r20178 1 2007-03-13 Brady Eidson <beidson@apple.com> 2 3 Reviewed by Anders 4 5 <rdar://problem/5048818> - REGRESSION: Incompletely loaded resources being saved to the object cache 6 7 Due to a subtle change in loader behavior back in 10904, we would stop all loaders before calling 8 didFail() on them in the Cache loader. As a result, we basically cleared all of the Subresource Loaders 9 out of the Cache loader before more properly failing them as errored out. The result? Partially loaded 10 resources being cached. 11 12 Since Loader::didFail() both calls error() on the object *and* removes the loader, the solution is to call 13 didFail() for all cancelled loaders instead of *only* removing them from the set of active loaders. 14 15 In addition, pages that didn't completely load were being saved to the back/forward cache. To fix that, 16 I added a null check on the DocumentLoader's error to see if the page ended in an error, or did indeed 17 completely load. 18 19 Note that the layout test for this - if possible - will require other enhancements including possibly adding 20 support for window.stop(). That task is documented in <rdar://problem/5061826> 21 22 * loader/FrameLoader.cpp: 23 (WebCore::FrameLoader::provisionalLoadStarted): Fixed a few bugs relating to my original BFCache rewrite to 24 more perfectly restore the original behavior - including only caching HTML documents via the 25 m_client->canCachePage() call 26 (WebCore::FrameLoader::canCachePage): Don't make the call to m_client->canCachePage() as that serves a different 27 purpose 28 - Check the mainDocumentError to see if the load ended in error as a further criteria in determining the 29 cachability of a page 30 31 * loader/loader.cpp: 32 (WebCore::Loader::cancelRequests): Call didFail(cancelledError()) instead of just removing the loaders from the 33 loaders-in-progress set. This adds the effect of properly cleaning up the cached object. 34 1 35 2007-03-13 Beth Dakin <bdakin@apple.com> 2 36 -
trunk/WebCore/loader/FrameLoader.cpp
r20132 r20178 1479 1479 && loadType != FrameLoadTypeReloadAllowingStaleData 1480 1480 && loadType != FrameLoadTypeSame 1481 && !documentLoader()->isLoading ()1481 && !documentLoader()->isLoadingInAPISense() 1482 1482 && !documentLoader()->isStopping()) { 1483 1484 if (!m_currentHistoryItem->pageCache()) { 1485 // Add the items to this page's cache. 1486 if (createPageCache(m_currentHistoryItem.get())) { 1487 // See if any page caches need to be purged after the addition of this new page cache. 1488 purgePageCache(); 1483 if (m_client->canCachePage()) { 1484 if (!m_currentHistoryItem->pageCache()) { 1485 // Add the items to this page's cache. 1486 if (createPageCache(m_currentHistoryItem.get())) { 1487 // See if any page caches need to be purged after the addition of this new page cache. 1488 purgePageCache(); 1489 } 1489 1490 } 1491 } else { 1492 // Put the document into a null state, so it can be restored correctly. 1493 clear(); 1490 1494 } 1491 1495 } … … 1532 1536 1533 1537 bool FrameLoader::canCachePage() 1534 { 1535 if ( !m_client->canCachePage())1538 { 1539 if (documentLoader() && !documentLoader()->mainDocumentError().isNull()) 1536 1540 return false; 1537 1541 1538 1542 return m_frame->document() 1539 1543 && !m_frame->tree()->childCount() -
trunk/WebCore/loader/loader.cpp
r19977 r20178 224 224 for (unsigned i = 0; i < loadersToCancel.size(); ++i) { 225 225 SubresourceLoader* loader = loadersToCancel[i]; 226 Request* r = m_requestsLoading.get(loader); 227 m_requestsLoading.remove(loader); 228 cache()->remove(r->cachedResource()); 226 didFail(loader, loader->cancelledError()); 229 227 } 230 228 }
Note:
See TracChangeset
for help on using the changeset viewer.