Changeset 90947 in webkit
- Timestamp:
- Jul 13, 2011 2:40:40 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90940 r90947 1 2011-07-13 Joseph Pecoraro <joepeck@webkit.org> 2 3 Some ApplicationCache Origin Cleanup 4 https://bugs.webkit.org/show_bug.cgi?id=64431 5 6 Reviewed by Alexey Proskuryakov. 7 8 - m_loadedSize is inaccurate. This just replaces it with 9 calls to ApplicationCache::estimatedSizeInStorage. 10 11 - m_availableSpaceInQuota can get out of date, so we just 12 recalculate it at the start of appcache downloads. 13 14 * loader/appcache/ApplicationCacheGroup.h: 15 * loader/appcache/ApplicationCacheGroup.cpp: 16 (WebCore::ApplicationCacheGroup::ApplicationCacheGroup): 17 (WebCore::ApplicationCacheGroup::didReceiveData): 18 Remove references to m_loadedSize. 19 20 (WebCore::ApplicationCacheGroup::didFinishLoading): 21 Replace m_loadedSize with estimatedSizeInStorage after we 22 add the new cached resource to the cache. The calculation 23 already happened so this check is fast. 24 25 (WebCore::ApplicationCacheGroup::didFinishLoadingManifest): 26 When we start the Downloading phase, recalculate the quota 27 so that we have an up to date quota value so that we can 28 break early if needed. 29 1 30 2011-07-12 Brent Fulgham <bfulgham@webkit.org> 2 31 -
trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.cpp
r90856 r90947 71 71 , m_isCopy(isCopy) 72 72 , m_calledReachedMaxAppCacheSize(false) 73 , m_loadedSize(0)74 73 , m_availableSpaceInQuota(ApplicationCacheStorage::unknownQuota()) 75 74 , m_originQuotaExceededPreviously(false) … … 584 583 ASSERT(m_currentResource); 585 584 m_currentResource->data()->append(data, length); 586 587 m_loadedSize += length;588 585 } 589 586 … … 599 596 } 600 597 601 // After finishing the loading of any resource, we check if it will 602 // fit in our last known quota limit. 603 // FIXME: The quota could be changed by another appcache in the same origin. 604 if (m_availableSpaceInQuota == ApplicationCacheStorage::unknownQuota()) 605 recalculateAvailableSpaceInQuota(); 598 ASSERT(m_currentHandle == handle); 599 ASSERT(m_pendingEntries.contains(handle->firstRequest().url())); 600 601 m_pendingEntries.remove(handle->firstRequest().url()); 602 603 ASSERT(m_cacheBeingUpdated); 604 605 m_cacheBeingUpdated->addResource(m_currentResource.release()); 606 m_currentHandle = 0; 606 607 607 608 // While downloading check to see if we have exceeded the available quota. … … 610 611 // of the quota being reached and decided not to increase it then. 611 612 // FIXME: Should we break earlier and prevent redownloading on later page loads? 612 // We could then also get rid of m_loadedSize. 613 if (m_originQuotaExceededPreviously && m_availableSpaceInQuota < m_loadedSize) { 613 if (m_originQuotaExceededPreviously && m_availableSpaceInQuota < m_cacheBeingUpdated->estimatedSizeInStorage()) { 614 614 m_currentResource = 0; 615 615 m_frame->domWindow()->console()->addMessage(OtherMessageSource, LogMessageType, ErrorMessageLevel, "Application Cache update failed, because size quota was exceeded.", 0, String()); … … 617 617 return; 618 618 } 619 620 ASSERT(m_currentHandle == handle);621 ASSERT(m_pendingEntries.contains(handle->firstRequest().url()));622 623 m_pendingEntries.remove(handle->firstRequest().url());624 625 ASSERT(m_cacheBeingUpdated);626 627 m_cacheBeingUpdated->addResource(m_currentResource.release());628 m_currentHandle = 0;629 619 630 620 // Load the next resource, if any. … … 787 777 m_progressDone = 0; 788 778 779 recalculateAvailableSpaceInQuota(); 780 789 781 startLoadingEntry(); 790 782 } … … 984 976 setUpdateStatus(Idle); 985 977 m_frame = 0; 986 m_loadedSize = 0;987 978 m_availableSpaceInQuota = ApplicationCacheStorage::unknownQuota(); 988 979 m_calledReachedMaxAppCacheSize = false; -
trunk/Source/WebCore/loader/appcache/ApplicationCacheGroup.h
r90856 r90947 200 200 RefPtr<ResourceHandle> m_manifestHandle; 201 201 202 int64_t m_loadedSize;203 202 int64_t m_availableSpaceInQuota; 204 203 bool m_originQuotaExceededPreviously;
Note: See TracChangeset
for help on using the changeset viewer.