Changeset 124315 in webkit


Ignore:
Timestamp:
Aug 1, 2012 2:19:25 AM (12 years ago)
Author:
commit-queue@webkit.org
Message:

Web Inspector: Add native memory used by GlyphCache to the snapshot
https://bugs.webkit.org/show_bug.cgi?id=90615

Patch by Alexei Filippov <alexeif@chromium.org> on 2012-08-01
Reviewed by Yury Semikhatsky.

Adds interface for reporting memory usage of platform specific
components.
Report memory usage of the font cache allocated by skia in chromium.

  • inspector/InspectorMemoryAgent.cpp:

(WebCore::addPlatformComponentsInfo):
(WebCore):
(WebCore::InspectorMemoryAgent::getProcessMemoryDistribution):

  • inspector/front-end/NativeMemorySnapshotView.js:

(WebInspector.MemoryBlockViewProperties._initialize):

  • platform/MemoryUsageSupport.cpp:

(WebCore::MemoryUsageSupport::memoryUsageByComponents):
(WebCore):

  • platform/MemoryUsageSupport.h:

(MemoryUsageSupport):
(ComponentInfo):
(WebCore::MemoryUsageSupport::ComponentInfo::ComponentInfo):

  • platform/chromium/MemoryUsageSupportChromium.cpp:

(WebCore::MemoryUsageSupport::memoryUsageByComponents):
(WebCore):

  • platform/qt/MemoryUsageSupportQt.cpp:

(WebCore::MemoryUsageSupport::memoryUsageByComponents):
(WebCore):

Location:
trunk/Source/WebCore
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r124314 r124315  
     12012-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
    1322012-08-01  Yoshifumi Inoue  <yosin@chromium.org>
    233
  • trunk/Source/WebCore/inspector/InspectorMemoryAgent.cpp

    r124306 r124315  
    517517}
    518518
     519static 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
    519530static PassRefPtr<InspectorMemoryBlock> memoryCacheInfo()
    520531{
     
    574585    children->addItem(jsExternalResourcesInfo(visitedObjects));
    575586    children->addItem(inspectorData.dumpStatistics());
     587    addPlatformComponentsInfo(children);
    576588    processMemory->setChildren(children);
    577589
  • trunk/Source/WebCore/inspector/front-end/NativeMemorySnapshotView.js

    r123758 r124315  
    225225    addBlock("hsl(210, 60%,  80%)", "InspectorData", "Inspector data");
    226226    addBlock("hsl( 30, 60%,  80%)", "MemoryCache", "Memory cache resources");
     227    addBlock("hsl( 40, 60%,  80%)", "GlyphCache", "Glyph cache resources");
    227228    addBlock("hsl( 60, 60%,  80%)", "RenderTreeAllocated", "Render tree");
    228229    addBlock("hsl( 60, 60%,  80%)", "RenderTreeUsed", "Render tree used");
  • trunk/Source/WebCore/platform/MemoryUsageSupport.cpp

    r122087 r124315  
    6464}
    6565
     66void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>&)
     67{
     68}
     69
    6670} // namespace WebCore
  • trunk/Source/WebCore/platform/MemoryUsageSupport.h

    r122087 r124315  
    3232#define MemoryUsageSupport_h
    3333
     34#include <wtf/Forward.h>
     35#include <wtf/text/WTFString.h>
     36
    3437namespace WebCore {
    3538
     
    5861    // false on platform specific error conditions.
    5962    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>&);
    6074};
    6175
  • trunk/Source/WebCore/platform/chromium/MemoryUsageSupportChromium.cpp

    r122087 r124315  
    3232#include "MemoryUsageSupport.h"
    3333
     34#include <SkGraphics.h>
    3435#include <public/Platform.h>
    3536
     
    6667}
    6768
     69void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>& components)
     70{
     71    size_t size = SkGraphics::GetFontCacheUsed();
     72    components.append(ComponentInfo("GlyphCache", size));
     73}
     74
    6875} // namespace WebCore
  • trunk/Source/WebCore/platform/qt/MemoryUsageSupportQt.cpp

    r122474 r124315  
    112112}
    113113
     114void MemoryUsageSupport::memoryUsageByComponents(Vector<ComponentInfo>&)
     115{
     116}
     117
    114118} // namespace WebCore
Note: See TracChangeset for help on using the changeset viewer.