Changeset 124589 in webkit


Ignore:
Timestamp:
Aug 3, 2012 3:18:31 AM (12 years ago)
Author:
yurys@chromium.org
Message:

Web Inspector: add CSSRule memory instrumentation
https://bugs.webkit.org/show_bug.cgi?id=92962

Reviewed by Pavel Feldman.

Added memory footprint reporting method to CSSRule and its descendants.

  • css/CSSCharsetRule.cpp:

(WebCore::CSSCharsetRule::reportDescendantMemoryUsage):
(WebCore):

  • css/CSSCharsetRule.h:

(CSSCharsetRule):

  • css/CSSComputedStyleDeclaration.cpp:

(WebCore::CSSComputedStyleDeclaration::reportMemoryUsage):
(WebCore):

  • css/CSSComputedStyleDeclaration.h:

(CSSComputedStyleDeclaration):

  • css/CSSFontFaceRule.cpp:

(WebCore::CSSFontFaceRule::reportDescendantMemoryUsage):
(WebCore):

  • css/CSSFontFaceRule.h:

(CSSFontFaceRule):

  • css/CSSImportRule.cpp:

(WebCore::CSSImportRule::reportDescendantMemoryUsage):
(WebCore):

  • css/CSSImportRule.h:

(CSSImportRule):

  • css/CSSMediaRule.cpp:

(WebCore::CSSMediaRule::reportDescendantMemoryUsage):
(WebCore):

  • css/CSSMediaRule.h:

(CSSMediaRule):

  • css/CSSPageRule.cpp:

(WebCore::CSSPageRule::reportDescendantMemoryUsage):
(WebCore):

  • css/CSSPageRule.h:

(CSSPageRule):

  • css/CSSRule.cpp:

(WebCore::CSSRule::reportMemoryUsage): we manually implement polymorphic
call here to avoid adding vtable pointer to all CSSRule objects. Descendants
are expected to report their memory via reportDescendantMemoryUsage. The name
is intentionally different from reportMemoryUsage to avoid accidential infitite
recursion: if the descendants overrode non-virtual CSSRule::reportMemoryUsage,
it would be easy to add a new descendant type to the switch in
CSSRule::reportMemoryUsage without providing proper override for reportMemoryUsage
and CSSRule::reportMemoryUsage would end up calling itself.
(WebCore):
(WebCore::CSSRule::reportBaseClassMemoryUsage): again we cannot use
MemoryClassInfo::visitBaseClass like we do for virtual methods because it would
lead to a recursive call of CSSRule::reportMemoryUsage. This is why we use
reportBaseClassMemoryUsage to allow descendants to report objects referenced
from their base class.

  • css/CSSRule.h:

(WebCore):
(CSSRule):

  • css/CSSRuleList.cpp:

(WebCore::StaticCSSRuleList::reportMemoryUsage):
(WebCore):

  • css/CSSRuleList.h:

(WebCore):
(CSSRuleList):
(StaticCSSRuleList):
(LiveCSSRuleList):

  • css/CSSStyleDeclaration.h:

(WebCore):
(CSSStyleDeclaration):

  • css/CSSStyleRule.cpp:

(WebCore::CSSStyleRule::reportDescendantMemoryUsage):
(WebCore):

  • css/CSSStyleRule.h:

(CSSStyleRule):

  • css/CSSStyleSheet.cpp:

(StyleSheetCSSRuleList):
(WebCore::CSSStyleSheet::reportMemoryUsage):

  • css/CSSUnknownRule.h:

(CSSUnknownRule):
(WebCore::CSSUnknownRule::reportDescendantMemoryUsage):

  • css/PropertySetCSSStyleDeclaration.cpp:

(WebCore::PropertySetCSSStyleDeclaration::reportMemoryUsage):
(WebCore):
(WebCore::StyleRuleCSSStyleDeclaration::reportMemoryUsage):
(WebCore::InlineCSSStyleDeclaration::reportMemoryUsage):

  • css/PropertySetCSSStyleDeclaration.h:

(PropertySetCSSStyleDeclaration):
(StyleRuleCSSStyleDeclaration):
(InlineCSSStyleDeclaration):

  • css/WebKitCSSKeyframeRule.cpp:

(WebCore::WebKitCSSKeyframeRule::reportDescendantMemoryUsage):
(WebCore):

  • css/WebKitCSSKeyframeRule.h:

(WebKitCSSKeyframeRule):

  • css/WebKitCSSKeyframesRule.cpp:

(WebCore::WebKitCSSKeyframesRule::reportDescendantMemoryUsage):
(WebCore):

  • css/WebKitCSSKeyframesRule.h:

(WebKitCSSKeyframesRule):

  • css/WebKitCSSRegionRule.cpp:

(WebCore::WebKitCSSRegionRule::reportDescendantMemoryUsage):
(WebCore):

  • css/WebKitCSSRegionRule.h:

(WebKitCSSRegionRule):

Location:
trunk/Source/WebCore
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r124588 r124589  
     12012-08-03  Yury Semikhatsky  <yurys@chromium.org>
     2
     3        Web Inspector: add CSSRule memory instrumentation
     4        https://bugs.webkit.org/show_bug.cgi?id=92962
     5
     6        Reviewed by Pavel Feldman.
     7
     8        Added memory footprint reporting method to CSSRule and its descendants.
     9
     10        * css/CSSCharsetRule.cpp:
     11        (WebCore::CSSCharsetRule::reportDescendantMemoryUsage):
     12        (WebCore):
     13        * css/CSSCharsetRule.h:
     14        (CSSCharsetRule):
     15        * css/CSSComputedStyleDeclaration.cpp:
     16        (WebCore::CSSComputedStyleDeclaration::reportMemoryUsage):
     17        (WebCore):
     18        * css/CSSComputedStyleDeclaration.h:
     19        (CSSComputedStyleDeclaration):
     20        * css/CSSFontFaceRule.cpp:
     21        (WebCore::CSSFontFaceRule::reportDescendantMemoryUsage):
     22        (WebCore):
     23        * css/CSSFontFaceRule.h:
     24        (CSSFontFaceRule):
     25        * css/CSSImportRule.cpp:
     26        (WebCore::CSSImportRule::reportDescendantMemoryUsage):
     27        (WebCore):
     28        * css/CSSImportRule.h:
     29        (CSSImportRule):
     30        * css/CSSMediaRule.cpp:
     31        (WebCore::CSSMediaRule::reportDescendantMemoryUsage):
     32        (WebCore):
     33        * css/CSSMediaRule.h:
     34        (CSSMediaRule):
     35        * css/CSSPageRule.cpp:
     36        (WebCore::CSSPageRule::reportDescendantMemoryUsage):
     37        (WebCore):
     38        * css/CSSPageRule.h:
     39        (CSSPageRule):
     40        * css/CSSRule.cpp:
     41        (WebCore::CSSRule::reportMemoryUsage): we manually implement polymorphic
     42        call here to avoid adding vtable pointer to all CSSRule objects. Descendants
     43        are expected to report their memory via reportDescendantMemoryUsage. The name
     44        is intentionally different from reportMemoryUsage to avoid accidential infitite
     45        recursion: if the descendants overrode non-virtual CSSRule::reportMemoryUsage,
     46        it would be easy to add a new descendant type to the switch in
     47        CSSRule::reportMemoryUsage without providing proper override for reportMemoryUsage
     48        and CSSRule::reportMemoryUsage would end up calling itself.
     49        (WebCore):
     50        (WebCore::CSSRule::reportBaseClassMemoryUsage): again we cannot use
     51        MemoryClassInfo::visitBaseClass like we do for virtual methods because it would
     52        lead to a recursive call of CSSRule::reportMemoryUsage. This is why we use
     53        reportBaseClassMemoryUsage to allow descendants to report objects referenced
     54        from their base class.
     55        * css/CSSRule.h:
     56        (WebCore):
     57        (CSSRule):
     58        * css/CSSRuleList.cpp:
     59        (WebCore::StaticCSSRuleList::reportMemoryUsage):
     60        (WebCore):
     61        * css/CSSRuleList.h:
     62        (WebCore):
     63        (CSSRuleList):
     64        (StaticCSSRuleList):
     65        (LiveCSSRuleList):
     66        * css/CSSStyleDeclaration.h:
     67        (WebCore):
     68        (CSSStyleDeclaration):
     69        * css/CSSStyleRule.cpp:
     70        (WebCore::CSSStyleRule::reportDescendantMemoryUsage):
     71        (WebCore):
     72        * css/CSSStyleRule.h:
     73        (CSSStyleRule):
     74        * css/CSSStyleSheet.cpp:
     75        (StyleSheetCSSRuleList):
     76        (WebCore::CSSStyleSheet::reportMemoryUsage):
     77        * css/CSSUnknownRule.h:
     78        (CSSUnknownRule):
     79        (WebCore::CSSUnknownRule::reportDescendantMemoryUsage):
     80        * css/PropertySetCSSStyleDeclaration.cpp:
     81        (WebCore::PropertySetCSSStyleDeclaration::reportMemoryUsage):
     82        (WebCore):
     83        (WebCore::StyleRuleCSSStyleDeclaration::reportMemoryUsage):
     84        (WebCore::InlineCSSStyleDeclaration::reportMemoryUsage):
     85        * css/PropertySetCSSStyleDeclaration.h:
     86        (PropertySetCSSStyleDeclaration):
     87        (StyleRuleCSSStyleDeclaration):
     88        (InlineCSSStyleDeclaration):
     89        * css/WebKitCSSKeyframeRule.cpp:
     90        (WebCore::WebKitCSSKeyframeRule::reportDescendantMemoryUsage):
     91        (WebCore):
     92        * css/WebKitCSSKeyframeRule.h:
     93        (WebKitCSSKeyframeRule):
     94        * css/WebKitCSSKeyframesRule.cpp:
     95        (WebCore::WebKitCSSKeyframesRule::reportDescendantMemoryUsage):
     96        (WebCore):
     97        * css/WebKitCSSKeyframesRule.h:
     98        (WebKitCSSKeyframesRule):
     99        * css/WebKitCSSRegionRule.cpp:
     100        (WebCore::WebKitCSSRegionRule::reportDescendantMemoryUsage):
     101        (WebCore):
     102        * css/WebKitCSSRegionRule.h:
     103        (WebKitCSSRegionRule):
     104
    11052012-08-03  Adam Barth  <abarth@webkit.org>
    2106
  • trunk/Source/WebCore/css/CSSCharsetRule.cpp

    r99708 r124589  
    2222#include "CSSCharsetRule.h"
    2323
     24#include "MemoryInstrumentation.h"
     25
    2426namespace WebCore {
    2527
     
    3537}
    3638
     39void CSSCharsetRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     40{
     41    MemoryClassInfo<CSSCharsetRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     42    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     43    info.addString(m_encoding);
     44}
     45
    3746} // namespace WebCore
  • trunk/Source/WebCore/css/CSSCharsetRule.h

    r99708 r124589  
    4040    String cssText() const;
    4141
     42    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     43
    4244private:
    4345    CSSCharsetRule(CSSStyleSheet* parent, const String& encoding);
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp

    r124389 r124589  
    4747#include "FontFeatureValue.h"
    4848#include "FontValue.h"
     49#include "MemoryInstrumentation.h"
    4950#include "Pair.h"
    5051#include "Rect.h"
     
    26852686}
    26862687
     2688void CSSComputedStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     2689{
     2690    MemoryClassInfo<CSSComputedStyleDeclaration> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     2691    info.addInstrumentedMember(m_node);
     2692}
     2693
    26872694CSSRule* CSSComputedStyleDeclaration::parentRule() const
    26882695{
  • trunk/Source/WebCore/css/CSSComputedStyleDeclaration.h

    r116645 r124589  
    7373    PassRefPtr<StylePropertySet> copyPropertiesInSet(const CSSPropertyID* set, unsigned length) const;
    7474
     75    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
     76
    7577private:
    7678    CSSComputedStyleDeclaration(PassRefPtr<Node>, bool allowVisitedStyle, const String&);
  • trunk/Source/WebCore/css/CSSFontFaceRule.cpp

    r118761 r124589  
    2323#include "CSSFontFaceRule.h"
    2424
     25#include "MemoryInstrumentation.h"
    2526#include "StylePropertySet.h"
    2627#include "StyleRule.h"
     
    6465}
    6566
     67void CSSFontFaceRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     68{
     69    MemoryClassInfo<CSSFontFaceRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     70    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     71    info.addInstrumentedMember(m_fontFaceRule);
     72    info.addInstrumentedMember(m_propertiesCSSOMWrapper);
     73}
     74
    6675} // namespace WebCore
  • trunk/Source/WebCore/css/CSSFontFaceRule.h

    r116291 r124589  
    4646    void reattach(StyleRuleFontFace*);
    4747
     48    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     49
    4850private:
    4951    CSSFontFaceRule(StyleRuleFontFace*, CSSStyleSheet* parent);
  • trunk/Source/WebCore/css/CSSImportRule.cpp

    r118376 r124589  
    2828#include "Document.h"
    2929#include "MediaList.h"
     30#include "MemoryInstrumentation.h"
    3031#include "SecurityOrigin.h"
    3132#include "StyleRuleImport.h"
     
    7778}
    7879
     80void CSSImportRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     81{
     82    MemoryClassInfo<CSSImportRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     83    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     84    info.addInstrumentedMember(m_importRule);
     85    info.addInstrumentedMember(m_mediaCSSOMWrapper);
     86    info.addInstrumentedMember(m_styleSheetCSSOMWrapper);
     87}
     88
    7989CSSStyleSheet* CSSImportRule::styleSheet() const
    8090{
  • trunk/Source/WebCore/css/CSSImportRule.h

    r118376 r124589  
    4444    String cssText() const;
    4545
     46    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     47
    4648private:
    4749    CSSImportRule(StyleRuleImport*, CSSStyleSheet*);
  • trunk/Source/WebCore/css/CSSMediaRule.cpp

    r121551 r124589  
    2828#include "CSSStyleSheet.h"
    2929#include "ExceptionCode.h"
     30#include "MemoryInstrumentation.h"
    3031#include "StyleRule.h"
    3132#include <wtf/text/StringBuilder.h>
     
    175176}
    176177
     178void CSSMediaRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     179{
     180    MemoryClassInfo<CSSMediaRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     181    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     182    info.addInstrumentedMember(m_mediaCSSOMWrapper);
     183    info.addInstrumentedVector(m_childRuleCSSOMWrappers);
     184    info.addInstrumentedMember(m_ruleListCSSOMWrapper);
     185}
     186
    177187} // namespace WebCore
  • trunk/Source/WebCore/css/CSSMediaRule.h

    r116291 r124589  
    5353    void reattach(StyleRuleMedia*);
    5454
     55    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     56
    5557private:
    5658    CSSMediaRule(StyleRuleMedia*, CSSStyleSheet*);
  • trunk/Source/WebCore/css/CSSPageRule.cpp

    r118761 r124589  
    9696}
    9797
     98void CSSPageRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     99{
     100    MemoryClassInfo<CSSPageRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     101    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     102    info.addInstrumentedMember(m_pageRule);
     103    info.addInstrumentedMember(m_propertiesCSSOMWrapper);
     104}
     105
    98106} // namespace WebCore
  • trunk/Source/WebCore/css/CSSPageRule.h

    r116291 r124589  
    4949    void reattach(StyleRulePage*);
    5050
     51    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     52
    5153private:
    5254    CSSPageRule(StyleRulePage*, CSSStyleSheet*);
  • trunk/Source/WebCore/css/CSSRule.cpp

    r120943 r124589  
    165165}
    166166
     167void CSSRule::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     168{
     169    switch (type()) {
     170    case UNKNOWN_RULE:
     171        static_cast<const CSSUnknownRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     172        return;
     173    case STYLE_RULE:
     174        static_cast<const CSSStyleRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     175        return;
     176    case PAGE_RULE:
     177        static_cast<const CSSPageRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     178        return;
     179    case CHARSET_RULE:
     180        static_cast<const CSSCharsetRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     181        return;
     182    case IMPORT_RULE:
     183        static_cast<const CSSImportRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     184        return;
     185    case MEDIA_RULE:
     186        static_cast<const CSSMediaRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     187        return;
     188    case FONT_FACE_RULE:
     189        static_cast<const CSSFontFaceRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     190        return;
     191    case WEBKIT_KEYFRAMES_RULE:
     192        static_cast<const WebKitCSSKeyframesRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     193        return;
     194    case WEBKIT_KEYFRAME_RULE:
     195        static_cast<const WebKitCSSKeyframeRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     196        return;
     197#if ENABLE(CSS_REGIONS)
     198    case WEBKIT_REGION_RULE:
     199        static_cast<const WebKitCSSRegionRule*>(this)->reportDescendantMemoryUsage(memoryObjectInfo);
     200        return;
     201#endif
     202    }
     203    ASSERT_NOT_REACHED();
     204    return;
     205}
     206
    167207const CSSParserContext& CSSRule::parserContext() const
    168208{
     
    171211}
    172212
     213void CSSRule::reportBaseClassMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     214{
     215    MemoryClassInfo<CSSRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     216    if (m_parentIsRule)
     217        info.addInstrumentedMember(m_parentRule);
     218    else
     219        info.addInstrumentedMember(m_parentStyleSheet);
     220}
     221
    173222} // namespace WebCore
  • trunk/Source/WebCore/css/CSSRule.h

    r120943 r124589  
    3131
    3232class CSSStyleSheet;
     33class MemoryObjectInfo;
    3334class StyleRuleBase;
    3435struct CSSParserContext;
     
    104105    void reattach(StyleRuleBase*);
    105106
     107    void reportMemoryUsage(MemoryObjectInfo*) const;
     108
    106109protected:
    107110    CSSRule(CSSStyleSheet* parent, Type type)
     
    123126    const CSSParserContext& parserContext() const;
    124127
     128    void reportBaseClassMemoryUsage(MemoryObjectInfo*) const;
     129
    125130private:
    126131    mutable unsigned m_hasCachedSelectorText : 1;
  • trunk/Source/WebCore/css/CSSRuleList.cpp

    r112037 r124589  
    5252}
    5353
     54void StaticCSSRuleList::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     55{
     56    MemoryClassInfo<StaticCSSRuleList> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     57    info.addInstrumentedVector(m_rules);
     58}
     59
    5460} // namespace WebCore
  • trunk/Source/WebCore/css/CSSRuleList.h

    r112516 r124589  
    2323#define CSSRuleList_h
    2424
     25#include "MemoryInstrumentation.h"
    2526#include <wtf/PassRefPtr.h>
    2627#include <wtf/RefCounted.h>
     
    4647   
    4748    virtual CSSStyleSheet* styleSheet() const = 0;
     49
     50    virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0;
    4851   
    4952protected:
     
    6164   
    6265    virtual CSSStyleSheet* styleSheet() const { return 0; }
     66
     67    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
    6368
    6469private:   
     
    8186    virtual void ref() { m_rule->ref(); }
    8287    virtual void deref() { m_rule->deref(); }
     88
     89    virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE
     90    {
     91        MemoryClassInfo<LiveCSSRuleList<Rule> > info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     92        info.addInstrumentedMember(m_rule);
     93    }
    8394   
    8495private:
  • trunk/Source/WebCore/css/CSSStyleDeclaration.h

    r117369 r124589  
    3131class CSSStyleSheet;
    3232class CSSValue;
     33class MemoryObjectInfo;
    3334class StylePropertySet;
    3435class StyledElement;
     
    7071    virtual CSSStyleSheet* parentStyleSheet() const { return 0; }
    7172
     73    virtual void reportMemoryUsage(MemoryObjectInfo*) const = 0;
     74
    7275protected:
    7376    CSSStyleDeclaration() { }
  • trunk/Source/WebCore/css/CSSStyleRule.cpp

    r118761 r124589  
    2727#include "CSSStyleSheet.h"
    2828#include "Document.h"
     29#include "MemoryInstrumentation.h"
    2930#include "PropertySetCSSStyleDeclaration.h"
    3031#include "StylePropertySet.h"
     
    128129}
    129130
     131void CSSStyleRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     132{
     133    MemoryClassInfo<CSSStyleRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     134    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     135    info.addInstrumentedMember(m_styleRule);
     136    info.addInstrumentedMember(m_propertiesCSSOMWrapper);
     137}
     138
    130139} // namespace WebCore
  • trunk/Source/WebCore/css/CSSStyleRule.h

    r116291 r124589  
    5151    void reattach(StyleRule*);
    5252
     53    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     54
    5355private:
    5456    CSSStyleRule(StyleRule*, CSSStyleSheet*);
  • trunk/Source/WebCore/css/CSSStyleSheet.cpp

    r124330 r124589  
    5454   
    5555    virtual CSSStyleSheet* styleSheet() const { return m_styleSheet; }
     56
     57    virtual void reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const OVERRIDE
     58    {
     59        MemoryClassInfo<StyleSheetCSSRuleList> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     60        info.addInstrumentedMember(m_styleSheet);
     61    }
    5662   
    5763    CSSStyleSheet* m_styleSheet;
     
    177183    info.addInstrumentedMember(m_mediaQueries);
    178184    info.addInstrumentedMember(m_ownerNode);
     185    info.addInstrumentedMember(m_ownerRule);
    179186    info.addInstrumentedMember(m_mediaCSSOMWrapper);
     187    info.addInstrumentedVector(m_childRuleCSSOMWrappers);
    180188}
    181189
  • trunk/Source/WebCore/css/CSSUnknownRule.h

    r98859 r124589  
    2424
    2525#include "CSSRule.h"
     26#include "MemoryInstrumentation.h"
    2627
    2728namespace WebCore {
     
    3031public:
    3132    CSSUnknownRule() : CSSRule(0, CSSRule::UNKNOWN_RULE) { }
     33
     34    void reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     35    {
     36        MemoryClassInfo<CSSUnknownRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     37        CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     38    }
    3239};
    3340
  • trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp

    r123636 r124589  
    2727#include "HTMLNames.h"
    2828#include "InspectorInstrumentation.h"
     29#include "MemoryInstrumentation.h"
    2930#include "MutationObserverInterestGroup.h"
    3031#include "MutationRecord.h"
     
    131132}
    132133
     134void PropertySetCSSStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     135{
     136    MemoryClassInfo<PropertySetCSSStyleDeclaration> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     137    info.addInstrumentedMember(m_propertySet);
     138    // FIXME: add info.addInstrumentedHasMap(m_cssomCSSValueClones) when CSSValue is instrumented.
     139}
     140
    133141unsigned PropertySetCSSStyleDeclaration::length() const
    134142{
     
    381389}
    382390
     391void StyleRuleCSSStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     392{
     393    MemoryClassInfo<StyleRuleCSSStyleDeclaration> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     394    info.visitBaseClass(this);
     395    info.addInstrumentedMember(m_parentRule);
     396}
     397
     398void InlineCSSStyleDeclaration::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     399{
     400    MemoryClassInfo<InlineCSSStyleDeclaration> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     401    info.visitBaseClass(this);
     402    info.addInstrumentedMember(m_parentElement);
     403}
     404
    383405void InlineCSSStyleDeclaration::didMutate(MutationType type)
    384406{
  • trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.h

    r121982 r124589  
    4848    virtual void ref() OVERRIDE;
    4949    virtual void deref() OVERRIDE;
     50
     51    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
    5052
    5153protected:
     
    100102    void reattach(StylePropertySet*);
    101103
     104    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
     105
    102106private:
    103107    StyleRuleCSSStyleDeclaration(StylePropertySet*, CSSRule*);
     
    125129    {
    126130    }
     131
     132    virtual void reportMemoryUsage(MemoryObjectInfo*) const OVERRIDE;
    127133   
    128134private:
  • trunk/Source/WebCore/css/WebKitCSSKeyframeRule.cpp

    r124330 r124589  
    114114}
    115115
     116void WebKitCSSKeyframeRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     117{
     118    MemoryClassInfo<WebKitCSSKeyframeRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     119    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     120    info.addInstrumentedMember(m_keyframe);
     121    info.addInstrumentedMember(m_propertiesCSSOMWrapper);
     122}
     123
    116124} // namespace WebCore
  • trunk/Source/WebCore/css/WebKitCSSKeyframeRule.h

    r124330 r124589  
    8181    String cssText() const { return m_keyframe->cssText(); }
    8282
     83    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     84
    8385private:
    8486    WebKitCSSKeyframeRule(StyleKeyframe*, WebKitCSSKeyframesRule* parent);
  • trunk/Source/WebCore/css/WebKitCSSKeyframesRule.cpp

    r124435 r124589  
    207207}
    208208
     209void WebKitCSSKeyframesRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     210{
     211    MemoryClassInfo<WebKitCSSKeyframesRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     212    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     213    info.addInstrumentedMember(m_keyframesRule);
     214    info.addInstrumentedVector(m_childRuleCSSOMWrappers);
     215    info.addInstrumentedMember(m_ruleListCSSOMWrapper);
     216}
     217
    209218} // namespace WebCore
  • trunk/Source/WebCore/css/WebKitCSSKeyframesRule.h

    r124435 r124589  
    9393    void reattach(StyleRuleKeyframes*);
    9494
     95    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     96
    9597private:
    9698    WebKitCSSKeyframesRule(StyleRuleKeyframes*, CSSStyleSheet* parent);
  • trunk/Source/WebCore/css/WebKitCSSRegionRule.cpp

    r118484 r124589  
    109109}
    110110
     111void WebKitCSSRegionRule::reportDescendantMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
     112{
     113    MemoryClassInfo<WebKitCSSRegionRule> info(memoryObjectInfo, this, MemoryInstrumentation::CSS);
     114    CSSRule::reportBaseClassMemoryUsage(memoryObjectInfo);
     115    info.addInstrumentedMember(m_regionRule);
     116    info.addInstrumentedVector(m_childRuleCSSOMWrappers);
     117    info.addInstrumentedMember(m_ruleListCSSOMWrapper);
     118}
     119
    111120} // namespace WebCore
    112121
  • trunk/Source/WebCore/css/WebKitCSSRegionRule.h

    r118484 r124589  
    5858    void reattach(StyleRuleRegion*);
    5959
     60    void reportDescendantMemoryUsage(MemoryObjectInfo*) const;
     61
    6062private:
    6163    WebKitCSSRegionRule(StyleRuleRegion*, CSSStyleSheet* parent);
Note: See TracChangeset for help on using the changeset viewer.