| 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 665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 switch (resource->type()) { | 676 switch (resource->type()) { |
| 677 case CachedResource::ImageResource: | 677 case CachedResource::ImageResource: |
| 678 stats.images.addResource(resource); | 678 stats.images.addResource(resource); |
| 679 break; | 679 break; |
| 680 case CachedResource::CSSStyleSheet: | 680 case CachedResource::CSSStyleSheet: |
| 681 stats.cssStyleSheets.addResource(resource); | 681 stats.cssStyleSheets.addResource(resource); |
| 682 break; | 682 break; |
| 683 case CachedResource::Script: | 683 case CachedResource::Script: |
| 684 stats.scripts.addResource(resource); | 684 stats.scripts.addResource(resource); |
| 685 break; | 685 break; |
| 686 #if ENABLE(XSLT) | |
| 687 case CachedResource::XSLStyleSheet: | 686 case CachedResource::XSLStyleSheet: |
| 688 stats.xslStyleSheets.addResource(resource); | 687 stats.xslStyleSheets.addResource(resource); |
| 689 break; | 688 break; |
| 690 #endif | |
| 691 case CachedResource::FontResource: | 689 case CachedResource::FontResource: |
| 692 stats.fonts.addResource(resource); | 690 stats.fonts.addResource(resource); |
| 693 break; | 691 break; |
| 694 default: | 692 default: |
| 695 break; | 693 break; |
| 696 } | 694 } |
| 697 } | 695 } |
| 698 return stats; | 696 return stats; |
| 699 } | 697 } |
| 700 | 698 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 751 | 749 |
| 752 | 750 |
| 753 #ifndef NDEBUG | 751 #ifndef NDEBUG |
| 754 void MemoryCache::dumpStats() | 752 void MemoryCache::dumpStats() |
| 755 { | 753 { |
| 756 Statistics s = getStatistics(); | 754 Statistics s = getStatistics(); |
| 757 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "
LiveSize", "DecodedSize", "PurgeableSize", "PurgedSize"); | 755 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "", "Count", "Size", "
LiveSize", "DecodedSize", "PurgeableSize", "PurgedSize"); |
| 758 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "-------------", "----
---------", "-------------", "-------------", "-------------", "-------------",
"-------------"); | 756 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n", "-------------", "----
---------", "-------------", "-------------", "-------------", "-------------",
"-------------"); |
| 759 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); | 757 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); |
| 760 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); | 758 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); |
| 761 #if ENABLE(XSLT) | |
| 762 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); | 759 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); |
| 763 #endif | |
| 764 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); | 760 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); |
| 765 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); | 761 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); |
| 766 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n\n", "-------------", "--
-----------", "-------------", "-------------", "-------------", "-------------"
, "-------------"); | 762 printf("%-13s %-13s %-13s %-13s %-13s %-13s %-13s\n\n", "-------------", "--
-----------", "-------------", "-------------", "-------------", "-------------"
, "-------------"); |
| 767 } | 763 } |
| 768 | 764 |
| 769 void MemoryCache::dumpLRULists(bool includeLive) const | 765 void MemoryCache::dumpLRULists(bool includeLive) const |
| 770 { | 766 { |
| 771 printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded
, Access count, Referenced, isPurgeable, wasPurged):\n"); | 767 printf("LRU-SP lists in eviction order (Kilobytes decoded, Kilobytes encoded
, Access count, Referenced, isPurgeable, wasPurged):\n"); |
| 772 | 768 |
| 773 int size = m_allResources.size(); | 769 int size = m_allResources.size(); |
| 774 for (int i = size - 1; i >= 0; i--) { | 770 for (int i = size - 1; i >= 0; i--) { |
| 775 printf("\n\nList %d: ", i); | 771 printf("\n\nList %d: ", i); |
| 776 CachedResource* current = m_allResources[i].m_tail; | 772 CachedResource* current = m_allResources[i].m_tail; |
| 777 while (current) { | 773 while (current) { |
| 778 CachedResource* prev = current->m_prevInAllResourcesList; | 774 CachedResource* prev = current->m_prevInAllResourcesList; |
| 779 if (includeLive || !current->hasClients()) | 775 if (includeLive || !current->hasClients()) |
| 780 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz
e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur
rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was
Purged()); | 776 printf("(%.1fK, %.1fK, %uA, %dR, %d, %d); ", current->decodedSiz
e() / 1024.0f, (current->encodedSize() + current->overheadSize()) / 1024.0f, cur
rent->accessCount(), current->hasClients(), current->isPurgeable(), current->was
Purged()); |
| 781 | 777 |
| 782 current = prev; | 778 current = prev; |
| 783 } | 779 } |
| 784 } | 780 } |
| 785 } | 781 } |
| 786 #endif | 782 #endif |
| 787 | 783 |
| 788 } // namespace WebCore | 784 } // namespace WebCore |
| OLD | NEW |