Report memory usage for ShadowDistributedRules.
authorhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 16:00:28 +0000 (16:00 +0000)
committerhayato@chromium.org <hayato@chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Apr 2013 16:00:28 +0000 (16:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=109882

Reviewed by Dimitri Glazkov.

This is a follow-up patch for r142855.

No new tests, no behavior change for layout tests.

* css/DocumentRuleSets.cpp:
(WebCore):
(WebCore::ShadowDistributedRules::reportMemoryUsage):
(WebCore::DocumentRuleSets::reportMemoryUsage):
* css/DocumentRuleSets.h:
(ShadowDistributedRules):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@147440 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/css/DocumentRuleSets.cpp
Source/WebCore/css/DocumentRuleSets.h

index db1c990..3aa6f37 100644 (file)
@@ -1,3 +1,21 @@
+2013-04-02  Hayato Ito  <hayato@chromium.org>
+
+        Report memory usage for ShadowDistributedRules.
+        https://bugs.webkit.org/show_bug.cgi?id=109882
+
+        Reviewed by Dimitri Glazkov.
+
+        This is a follow-up patch for r142855.
+
+        No new tests, no behavior change for layout tests.
+
+        * css/DocumentRuleSets.cpp:
+        (WebCore):
+        (WebCore::ShadowDistributedRules::reportMemoryUsage):
+        (WebCore::DocumentRuleSets::reportMemoryUsage):
+        * css/DocumentRuleSets.h:
+        (ShadowDistributedRules):
+
 2013-04-02  Chris Fleizach  <cfleizach@apple.com>
 
         AX: Need to get line thickness from fraction on web
index 0ff81b1..329a60d 100644 (file)
@@ -55,6 +55,12 @@ void ShadowDistributedRules::collectMatchRequests(bool includeEmptyRules, Vector
     for (ShadowDistributedRuleSetMap::iterator it = m_shadowDistributedRuleSetMap.begin(); it != m_shadowDistributedRuleSetMap.end(); ++it)
         matchRequests.append(MatchRequest(it->value.get(), includeEmptyRules, it->key));
 }
+
+void ShadowDistributedRules::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) const
+{
+    MemoryClassInfo info(memoryObjectInfo, this, WebCoreMemoryTypes::CSS);
+    info.addMember(m_shadowDistributedRuleSetMap, "shadowDistributedRuleSetMap");
+}
 #endif
 
 DocumentRuleSets::DocumentRuleSets()
@@ -162,6 +168,9 @@ void DocumentRuleSets::reportMemoryUsage(MemoryObjectInfo* memoryObjectInfo) con
     info.addMember(m_features, "features");
     info.addMember(m_siblingRuleSet, "siblingRuleSet");
     info.addMember(m_uncommonAttributeRuleSet, "uncommonAttributeRuleSet");
+#if ENABLE(SHADOW_DOM)
+    info.addMember(m_shadowDistributedRules, "shadowDistributedRules");
+#endif
 }
 
 } // namespace WebCore
index 8c4bdb8..a9c03e9 100644 (file)
@@ -48,6 +48,7 @@ public:
     void collectMatchRequests(bool includeEmptyRules, Vector<MatchRequest>&);
     void clear() { m_shadowDistributedRuleSetMap.clear(); }
     bool isEmpty() const { return m_shadowDistributedRuleSetMap.isEmpty(); }
+    void reportMemoryUsage(MemoryObjectInfo*) const;
 private:
     typedef HashMap<const ContainerNode*, OwnPtr<RuleSet> > ShadowDistributedRuleSetMap;
     ShadowDistributedRuleSetMap m_shadowDistributedRuleSetMap;