| OLD | NEW |
| 1 /* | 1 /* |
| 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) | 2 Copyright (C) 1998 Lars Knoll (knoll@mpi-hd.mpg.de) |
| 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) | 3 Copyright (C) 2001 Dirk Mueller (mueller@kde.org) |
| 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) | 4 Copyright (C) 2002 Waldo Bastian (bastian@kde.org) |
| 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 6 | 6 |
| 7 This library is free software; you can redistribute it and/or | 7 This library is free software; you can redistribute it and/or |
| 8 modify it under the terms of the GNU Library General Public | 8 modify it under the terms of the GNU Library General Public |
| 9 License as published by the Free Software Foundation; either | 9 License as published by the Free Software Foundation; either |
| 10 version 2 of the License, or (at your option) any later version. | 10 version 2 of the License, or (at your option) any later version. |
| (...skipping 725 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 736 ASSERT(ex); | 736 ASSERT(ex); |
| 737 ASSERT(ey); | 737 ASSERT(ey); |
| 738 return lruListFor(ex->m_accessCount, x->size()) == lruListFor(ey->m_accessCo
unt, y->size()); | 738 return lruListFor(ex->m_accessCount, x->size()) == lruListFor(ey->m_accessCo
unt, y->size()); |
| 739 } | 739 } |
| 740 | 740 |
| 741 #ifdef MEMORY_CACHE_STATS | 741 #ifdef MEMORY_CACHE_STATS |
| 742 | 742 |
| 743 void MemoryCache::dumpStats(TimerBase*) | 743 void MemoryCache::dumpStats(TimerBase*) |
| 744 { | 744 { |
| 745 Statistics s = getStatistics(); | 745 Statistics s = getStatistics(); |
| 746 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "
LiveSize", "DecodedSize", "PurgeableSize", "PurgedSize"); | 746 printf("%-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "LiveSize", "
DecodedSize"); |
| 747 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "-------------", "----
---------", "-------------", "-------------", "-------------", "-------------",
"-------------"); | 747 printf("%-13s %-13s %-13s %-13s %-13s\n", "-------------", "-------------",
"-------------", "-------------", "-------------"); |
| 748 printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Images", s.images.count, s.
images.size, s.images.liveSize, s.images.decodedSize, s.images.purgeableSize, s.
images.purgedSize); | 748 printf("%-13s %13zu %13zu %13zu %13zu\n", "Images", s.images.count, s.images
.size, s.images.liveSize, s.images.decodedSize); |
| 749 printf("%-13s %13d %13d %13d %13d %13d %13d\n", "CSS", s.cssStyleSheets.coun
t, s.cssStyleSheets.size, s.cssStyleSheets.liveSize, s.cssStyleSheets.decodedSiz
e, s.cssStyleSheets.purgeableSize, s.cssStyleSheets.purgedSize); | 749 printf("%-13s %13zu %13zu %13zu %13zu\n", "CSS", s.cssStyleSheets.count, s.c
ssStyleSheets.size, s.cssStyleSheets.liveSize, s.cssStyleSheets.decodedSize); |
| 750 printf("%-13s %13d %13d %13d %13d %13d %13d\n", "XSL", s.xslStyleSheets.coun
t, s.xslStyleSheets.size, s.xslStyleSheets.liveSize, s.xslStyleSheets.decodedSiz
e, s.xslStyleSheets.purgeableSize, s.xslStyleSheets.purgedSize); | 750 printf("%-13s %13zu %13zu %13zu %13zu\n", "XSL", s.xslStyleSheets.count, s.x
slStyleSheets.size, s.xslStyleSheets.liveSize, s.xslStyleSheets.decodedSize); |
| 751 printf("%-13s %13d %13d %13d %13d %13d %13d\n", "JavaScript", s.scripts.coun
t, s.scripts.size, s.scripts.liveSize, s.scripts.decodedSize, s.scripts.purgeabl
eSize, s.scripts.purgedSize); | 751 printf("%-13s %13zu %13zu %13zu %13zu\n", "JavaScript", s.scripts.count, s.s
cripts.size, s.scripts.liveSize, s.scripts.decodedSize); |
| 752 printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Fonts", s.fonts.count, s.fo
nts.size, s.fonts.liveSize, s.fonts.decodedSize, s.fonts.purgeableSize, s.fonts.
purgedSize); | 752 printf("%-13s %13zu %13zu %13zu %13zu\n", "Fonts", s.fonts.count, s.fonts.si
ze, s.fonts.liveSize, s.fonts.decodedSize); |
| 753 printf("%-13s %13d %13d %13d %13d %13d %13d\n", "Other", s.other.count, s.ot
her.size, s.other.liveSize, s.other.decodedSize, s.other.purgeableSize, s.other.
purgedSize); | 753 printf("%-13s %13zu %13zu %13zu %13zu\n", "Other", s.other.count, s.other.si
ze, s.other.liveSize, s.other.decodedSize); |
| 754 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n\n", "-------------", "--
-----------", "-------------", "-------------", "-------------", "-------------"
, "-------------"); | 754 printf("%-13s %-13s %-13s %-13s %-13s\n\n", "-------------", "-------------"
, "-------------", "-------------", "-------------"); |
| 755 | 755 |
| 756 printf("Duplication of encoded data from data URLs\n"); | 756 printf("Duplication of encoded data from data URLs\n"); |
| 757 printf("%-13s %13d of %13d\n", "Images", s.images.encodedSizeDuplicatedI
nDataURLs, s.images.encodedSize); | 757 printf("%-13s %13zu of %13zu\n", "Images", s.images.encodedSizeDuplicate
dInDataURLs, s.images.encodedSize); |
| 758 printf("%-13s %13d of %13d\n", "CSS", s.cssStyleSheets.encodedSizeDup
licatedInDataURLs, s.cssStyleSheets.encodedSize); | 758 printf("%-13s %13zu of %13zu\n", "CSS", s.cssStyleSheets.encodedSizeD
uplicatedInDataURLs, s.cssStyleSheets.encodedSize); |
| 759 printf("%-13s %13d of %13d\n", "XSL", s.xslStyleSheets.encodedSizeDup
licatedInDataURLs, s.xslStyleSheets.encodedSize); | 759 printf("%-13s %13zu of %13zu\n", "XSL", s.xslStyleSheets.encodedSizeD
uplicatedInDataURLs, s.xslStyleSheets.encodedSize); |
| 760 printf("%-13s %13d of %13d\n", "JavaScript", s.scripts.encodedSizeDuplicated
InDataURLs, s.scripts.encodedSize); | 760 printf("%-13s %13zu of %13zu\n", "JavaScript", s.scripts.encodedSizeDuplicat
edInDataURLs, s.scripts.encodedSize); |
| 761 printf("%-13s %13d of %13d\n", "Fonts", s.fonts.encodedSizeDuplicatedIn
DataURLs, s.fonts.encodedSize); | 761 printf("%-13s %13zu of %13zu\n", "Fonts", s.fonts.encodedSizeDuplicated
InDataURLs, s.fonts.encodedSize); |
| 762 printf("%-13s %13d of %13d\n", "Other", s.other.encodedSizeDuplicatedIn
DataURLs, s.other.encodedSize); | 762 printf("%-13s %13zu of %13zu\n", "Other", s.other.encodedSizeDuplicated
InDataURLs, s.other.encodedSize); |
| 763 } | 763 } |
| 764 | 764 |
| 765 void MemoryCache::dumpLRULists(bool includeLive) const | 765 void MemoryCache::dumpLRULists(bool includeLive) const |
| 766 { | 766 { |
| 767 printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded
, Access count, Referenced, isPurgeable):\n"); | 767 printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded
, Access count, Referenced, isPurgeable):\n"); |
| 768 | 768 |
| 769 int size = m_allResources.size(); | 769 int size = m_allResources.size(); |
| 770 for (int i = size - 1; i >= 0; i--) { | 770 for (int i = size - 1; i >= 0; i--) { |
| 771 printf("\n\nList %d: ", i); | 771 printf("\n\nList %d: ", i); |
| 772 MemoryCacheEntry* current = m_allResources[i].m_tail; | 772 MemoryCacheEntry* current = m_allResources[i].m_tail; |
| 773 while (current) { | 773 while (current) { |
| 774 Resource* currentResource = current->resource(); | 774 Resource* currentResource = current->resource(); |
| 775 if (includeLive || !currentResource->hasClientsOrObservers()) | 775 if (includeLive || !currentResource->hasClientsOrObservers()) |
| 776 printf("(%.1fK, %.1fK, %uA, %dR); ", currentResource->decodedSiz
e() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSize()
) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers()); | 776 printf("(%.1fK, %.1fK, %uA, %dR); ", currentResource->decodedSiz
e() / 1024.0f, (currentResource->encodedSize() + currentResource->overheadSize()
) / 1024.0f, current->m_accessCount, currentResource->hasClientsOrObservers()); |
| 777 | 777 |
| 778 current = current->m_previousInAllResourcesList; | 778 current = current->m_previousInAllResourcesList; |
| 779 } | 779 } |
| 780 } | 780 } |
| 781 } | 781 } |
| 782 | 782 |
| 783 #endif // MEMORY_CACHE_STATS | 783 #endif // MEMORY_CACHE_STATS |
| 784 | 784 |
| 785 } // namespace blink | 785 } // namespace blink |
| OLD | NEW |