Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r165145 - ASSERT(newestManifest) fails in WebCore::ApplicationC…
…acheGroup::didFinishLoadingManifest() https://bugs.webkit.org/show_bug.cgi?id=129753 <rdar://problem/12069835> Reviewed by Alexey Proskuryakov. Fixes an issue where an assertion failure would occur when visiting a web site whose on-disk app cache doesn't contain a manifest resource. For some reason an app cache for a web site may be partially written to disk. In particular, the app cache may only contain a CacheGroups entry. That is, the manifest resource and origin records may not be persisted to disk. From looking over the code, we're unclear how such a situation can occur and hence have been unable to create such an app cache. We were able to reproduce this issue using an app cache database file that was provided by a person that was affected by this issue. No test included because it's not straightforward to write a test for this change. * loader/appcache/ApplicationCacheGroup.cpp: (WebCore::ApplicationCacheGroup::checkIfLoadIsComplete): Assert that m_cacheBeingUpdated->manifestResource() is non-null. Currently we only document this assumption in a code comment. Also separated a single assertion expression into two assertion expressions to make it straightforward to identify the failing sub-expression on failure. * loader/appcache/ApplicationCacheStorage.cpp: (WebCore::ApplicationCacheStorage::store): Modified to call ApplicationCacheStorage::deleteCacheGroupRecord() to remove a cache group and associated cache records (if applicable) before inserting a cache group entry. This replacement approach will ultimately repair incomplete app cache data for people affected by this bug. (WebCore::ApplicationCacheStorage::loadCache): Log an error and return nullptr if the cache we loaded doesn't have a manifest resource. (WebCore::ApplicationCacheStorage::deleteCacheGroupRecord): Added. (WebCore::ApplicationCacheStorage::deleteCacheGroup): Extracted deletion logic for cache group record into ApplicationCacheStorage::deleteCacheGroupRecord(). * loader/appcache/ApplicationCacheStorage.h:
- Loading branch information
1 parent
39138c2
commit cac3f38
Showing
4 changed files
with
84 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters