Changeset 121968 in webkit
- Timestamp:
- Jul 6, 2012 7:09:12 AM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r121958 r121968 1 2012-07-06 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 * inspector/InspectorMemoryAgent.cpp: 9 (MemoryBlockName): 10 (WebCore): 11 (WebCore::addPlatformComponentsInfo): 12 (WebCore::InspectorMemoryAgent::getProcessMemoryDistribution): 13 * inspector/front-end/NativeMemorySnapshotView.js: 14 (WebInspector.MemoryBlockViewProperties._initialize): 15 * platform/MemoryUsageSupport.cpp: 16 (WebCore::MemoryUsageSupport::memoryUsageByComponents): 17 (WebCore): 18 * platform/MemoryUsageSupport.h: 19 (MemoryUsageSupport): 20 (ComponentInfo): 21 (WebCore::MemoryUsageSupport::ComponentInfo::ComponentInfo): 22 * platform/chromium/MemoryUsageSupportChromium.cpp: 23 (WebCore::glyphCacheVisitor): 24 (WebCore): 25 (WebCore::MemoryUsageSupport::memoryUsageByComponents): 26 1 27 2012-07-06 Oswald Buddenhagen <oswald.buddenhagen@nokia.com> 2 28 -
trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp
r121952 r121968 545 545 } 546 546 547 static void addPlatformComponentsInfo(PassRefPtr<TypeBuilder::Array<InspectorMemoryBlock> > children) 548 { 549 Vector<MemoryUsageSupport::ComponentInfo> components; 550 MemoryUsageSupport::memoryUsageByComponents(components); 551 for (Vector<MemoryUsageSupport::ComponentInfo>::iterator it = components.begin(); it != components.end(); ++it) { 552 RefPtr<InspectorMemoryBlock> block = InspectorMemoryBlock::create().setName(it->m_name); 553 block->setSize(it->m_sizeInBytes); 554 children->addItem(block); 555 } 556 } 557 547 558 static PassRefPtr<InspectorMemoryBlock> memoryCacheInfo() 548 559 { … … 603 614 children->addItem(domTreeInfo(m_page, visitedObjects)); // TODO: collect for all pages? 604 615 children->addItem(jsExternalResourcesInfo(visitedObjects)); 616 addPlatformComponentsInfo(children); 605 617 processMemory->setChildren(children); 606 618 } -
trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js
r121549 r121968 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
r119068 r121968 64 64 } 65 65 66 void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>&) 67 { 68 } 69 66 70 } // namespace WebCore -
trunk/Source/WebCore/platform/MemoryUsageSupport.h
r119068 r121968 32 32 #define MemoryUsageSupport_h 33 33 34 #include <wtf/Vector.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
r119068 r121968 33 33 34 34 #include <public/Platform.h> 35 #include <third_party/skia/src/core/SkGlyphCache.h> 35 36 36 37 namespace WebCore { … … 66 67 } 67 68 69 static bool glyphCacheVisitor(SkGlyphCache* cache, void* context) 70 { 71 size_t* sizePtr = reinterpret_cast<size_t*>(context); 72 *sizePtr += sizeof(*cache); 73 return false; 74 } 75 76 void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>& components) 77 { 78 size_t size = 0; 79 SkGlyphCache::VisitAllCaches(glyphCacheVisitor, &size); 80 components.append(ComponentInfo("GlyphCache", size)); 81 } 82 68 83 } // namespace WebCore
Note: See TracChangeset
for help on using the changeset viewer.