Changeset 124315 in webkit
- Timestamp:
- Aug 1, 2012 2:19:25 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r124314 r124315 1 2012-08-01 Alexei Filippov <alexeif@chromium.org> 2 3 Web Inspector: Add native memory used by GlyphCache to the snapshot 4 https://bugs.webkit.org/show_bug.cgi?id=90615 5 6 Reviewed by Yury Semikhatsky. 7 8 Adds interface for reporting memory usage of platform specific 9 components. 10 Report memory usage of the font cache allocated by skia in chromium. 11 12 * inspector/InspectorMemoryAgent.cpp: 13 (WebCore::addPlatformComponentsInfo): 14 (WebCore): 15 (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution): 16 * inspector/front-end/NativeMemorySnapshotView.js: 17 (WebInspector.MemoryBlockViewProperties._initialize): 18 * platform/MemoryUsageSupport.cpp: 19 (WebCore::MemoryUsageSupport::memoryUsageByComponents): 20 (WebCore): 21 * platform/MemoryUsageSupport.h: 22 (MemoryUsageSupport): 23 (ComponentInfo): 24 (WebCore::MemoryUsageSupport::ComponentInfo::ComponentInfo): 25 * platform/chromium/MemoryUsageSupportChromium.cpp: 26 (WebCore::MemoryUsageSupport::memoryUsageByComponents): 27 (WebCore): 28 * platform/qt/MemoryUsageSupportQt.cpp: 29 (WebCore::MemoryUsageSupport::memoryUsageByComponents): 30 (WebCore): 31 1 32 2012-08-01 Yoshifumi Inoue <yosin@chromium.org> 2 33 -
trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp
r124306 r124315 517 517 } 518 518 519 static void addPlatformComponentsInfo(PassRefPtr<TypeBuilder::Array<InspectorMemoryBlock> > children) 520 { 521 Vector<MemoryUsageSupport::ComponentInfo> components; 522 MemoryUsageSupport::memoryUsageByComponents(components); 523 for (Vector<MemoryUsageSupport::ComponentInfo>::iterator it = components.begin(); it != components.end(); ++it) { 524 RefPtr<InspectorMemoryBlock> block = InspectorMemoryBlock::create().setName(it->m_name); 525 block->setSize(it->m_sizeInBytes); 526 children->addItem(block); 527 } 528 } 529 519 530 static PassRefPtr<InspectorMemoryBlock> memoryCacheInfo() 520 531 { … … 574 585 children->addItem(jsExternalResourcesInfo(visitedObjects)); 575 586 children->addItem(inspectorData.dumpStatistics()); 587 addPlatformComponentsInfo(children); 576 588 processMemory->setChildren(children); 577 589 -
trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js
r123758 r124315 225 225 addBlock("hsl(210, 60%, 80%)", "InspectorData", "Inspector data"); 226 226 addBlock("hsl( 30, 60%, 80%)", "MemoryCache", "Memory cache resources"); 227 addBlock("hsl( 40, 60%, 80%)", "GlyphCache", "Glyph cache resources"); 227 228 addBlock("hsl( 60, 60%, 80%)", "RenderTreeAllocated", "Render tree"); 228 229 addBlock("hsl( 60, 60%, 80%)", "RenderTreeUsed", "Render tree used"); -
trunk/Source/WebCore/platform/MemoryUsageSupport.cpp
r122087 r124315 64 64 } 65 65 66 void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>&) 67 { 68 } 69 66 70 } // namespace WebCore -
trunk/Source/WebCore/platform/MemoryUsageSupport.h
r122087 r124315 32 32 #define MemoryUsageSupport_h 33 33 34 #include <wtf/Forward.h> 35 #include <wtf/text/WTFString.h> 36 34 37 namespace WebCore { 35 38 … … 58 61 // false on platform specific error conditions. 59 62 static bool processMemorySizesInBytes(size_t* privateBytes, size_t* sharedBytes); 63 64 class ComponentInfo { 65 public: 66 ComponentInfo(const String& name, size_t size) : m_name(name), m_sizeInBytes(size) { } 67 68 const String m_name; 69 size_t m_sizeInBytes; 70 }; 71 72 // Reports private memory used by components in bytes. 73 static void memoryUsageByComponents(Vector<ComponentInfo>&); 60 74 }; 61 75 -
trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp
r122087 r124315 32 32 #include "MemoryUsageSupport.h" 33 33 34 #include <SkGraphics.h> 34 35 #include <public/Platform.h> 35 36 … … 66 67 } 67 68 69 void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>& components) 70 { 71 size_t size = SkGraphics::GetFontCacheUsed(); 72 components.append(ComponentInfo("GlyphCache", size)); 73 } 74 68 75 } // namespace WebCore -
trunk/Source/WebCore/platform/qt/MemoryUsageSupportQt.cpp
r122474 r124315 112 112 } 113 113 114 void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>&) 115 { 116 } 117 114 118 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.