Changeset 50213 in webkit
- Timestamp:
- Oct 28, 2009 4:44:23 AM (15 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r50208 r50213 1 2009-10-26 Holger Hans Peter Freyther <zecke@selfish.org> 2 3 Reviewed by Darin Adler. 4 5 Document a feature of the m_liveDecodedResources list. 6 https://bugs.webkit.org/show_bug.cgi?id=30209 7 8 The code made the assumption that the list is sorted by 9 the m_lastDecodedAccessTime property of the CachedResource. 10 The above is not true when CachedResource::setDecodedSize 11 is called and the item is inserted the first time. In this 12 case the m_lastDecodedAccessTime is still zero and the 13 m_liveDecodedResources list becomes unsorted. 14 15 It is impossible that Cache::pruneLiveResources will 16 stop to process the list too early due this feature and 17 the alternatives of updating m_lastDecodedAccessTime in 18 CachedResource::setDecodedSize or changing the insert 19 to search the right position have a negative impact on 20 performance. The best solution for now is to document 21 this feature. 22 23 * loader/Cache.cpp: 24 (WebCore::Cache::pruneLiveResources): 25 * loader/CachedResource.cpp: 26 (WebCore::CachedResource::setDecodedSize): 27 1 28 2009-10-28 Xan Lopez <xlopez@igalia.com> 2 29 -
trunk/WebCore/loader/Cache.cpp
r49212 r50213 276 276 // Destroy any decoded data in live objects that we can. 277 277 // Start from the tail, since this is the least recently accessed of the objects. 278 279 // The list might not be sorted by the m_lastDecodedAccessTime. The impact 280 // of this weaker invariant is minor as the below if statement to check the 281 // elapsedTime will evaluate to false as the currentTime will be a lot 282 // greater than the current->m_lastDecodedAccessTime. 283 // For more details see: https://bugs.webkit.org/show_bug.cgi?id=30209 278 284 CachedResource* current = m_liveDecodedResources.m_tail; 279 285 while (current) { -
trunk/WebCore/loader/CachedResource.cpp
r47624 r50213 243 243 244 244 // Insert into or remove from the live decoded list if necessary. 245 // When inserting into the LiveDecodedResourcesList it is possible 246 // that the m_lastDecodedAccessTime is still zero or smaller than 247 // the m_lastDecodedAccessTime of the current list head. This is a 248 // violation of the invariant that the list is to be kept sorted 249 // by access time. The weakening of the invariant does not pose 250 // a problem. For more details please see: https://bugs.webkit.org/show_bug.cgi?id=30209 245 251 if (m_decodedSize && !m_inLiveDecodedResourcesList && hasClients()) 246 252 cache()->insertInLiveDecodedResourcesList(this);
Note: See TracChangeset
for help on using the changeset viewer.