Changeset 87344 in webkit
- Timestamp:
- May 25, 2011, 6:07:57 PM (14 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r87343 r87344 1 2011-05-25 James Robinson <jamesr@chromium.org> 2 3 Reviewed by Geoffrey Garen 4 5 CachedResource overhead size calculation ignores the actual size of the URL 6 https://bugs.webkit.org/show_bug.cgi?id=61481 7 8 CachedResource::overheadSize is used to determine the size of an entry in the memory cache to know when to evict 9 it. When the resource is a large data: URL, for example representing image or audio data, the URL size itself 10 can be significant. 11 12 This patch uses an estimate of actual number of bytes used by the URL that is valid for ASCII urls and close for 13 other types of strings instead of a fixed number. 14 15 * loader/cache/CachedResource.cpp: 16 (WebCore::CachedResource::overheadSize): 17 1 18 2011-05-25 Oliver Hunt <oliver@apple.com> 2 19 -
trunk/Source/WebCore/loader/cache/CachedResource.cpp
r87239 r87344 608 608 unsigned CachedResource::overheadSize() const 609 609 { 610 return sizeof(CachedResource) + m_response.memoryUsage() + 576; 611 /* 612 576 = 192 + // average size of m_url 613 384; // average size of m_clients hash map 614 */ 610 static const int kAverageClientsHashMapSize = 384; 611 return sizeof(CachedResource) + m_response.memoryUsage() + kAverageClientsHashMapSize + m_resourceRequest.url().string().length() * 2; 615 612 } 616 613
Note:
See TracChangeset
for help on using the changeset viewer.