Index: third_party/WebKit/Source/core/css/StyleRule.cpp |
diff --git a/third_party/WebKit/Source/core/css/StyleRule.cpp b/third_party/WebKit/Source/core/css/StyleRule.cpp |
index 7ff3eff764fff8a1e13dffdda1ebad8bc0446605..cad1d7a4e6c80cde32e78e00ac3ea492c762a8f5 100644 |
--- a/third_party/WebKit/Source/core/css/StyleRule.cpp |
+++ b/third_party/WebKit/Source/core/css/StyleRule.cpp |
@@ -52,6 +52,46 @@ PassRefPtrWillBeRawPtr<CSSRule> StyleRuleBase::createCSSOMWrapper(CSSRule* paren |
return createCSSOMWrapper(0, parentRule); |
} |
+void StyleRuleBase::purgeMemory() |
+{ |
+ switch (type()) { |
+ case Charset: |
+ toStyleRuleCharset(this)->purgeMemory(); |
+ return; |
+ case Style: |
+ toStyleRule(this)->purgeMemory(); |
+ return; |
+ case Page: |
+ toStyleRulePage(this)->purgeMemory(); |
+ return; |
+ case FontFace: |
+ toStyleRuleFontFace(this)->purgeMemory(); |
+ return; |
+ case Media: |
+ toStyleRuleMedia(this)->purgeMemory(); |
+ return; |
+ case Supports: |
+ toStyleRuleSupports(this)->purgeMemory(); |
+ return; |
+ case Import: |
+ toStyleRuleImport(this)->purgeMemory(); |
+ return; |
+ case Keyframes: |
+ toStyleRuleKeyframes(this)->purgeMemory(); |
+ return; |
+ case Keyframe: |
+ toStyleRuleKeyframe(this)->purgeMemory(); |
+ return; |
+ case Namespace: |
+ toStyleRuleNamespace(this)->purgeMemory(); |
+ return; |
+ case Viewport: |
+ toStyleRuleViewport(this)->purgeMemory(); |
+ return; |
+ } |
+ ASSERT_NOT_REACHED(); |
+} |
+ |
DEFINE_TRACE(StyleRuleBase) |
{ |
switch (type()) { |
@@ -275,6 +315,12 @@ MutableStylePropertySet& StyleRule::mutableProperties() |
return *toMutableStylePropertySet(m_properties.get()); |
} |
+ |
+void StyleRule::purgeMemory() |
+{ |
+ m_properties->purgeMemory(); |
+} |
+ |
DEFINE_TRACE_AFTER_DISPATCH(StyleRule) |
{ |
visitor->trace(m_properties); |
@@ -306,6 +352,11 @@ MutableStylePropertySet& StyleRulePage::mutableProperties() |
return *toMutableStylePropertySet(m_properties.get()); |
} |
+void StyleRulePage::purgeMemory() |
+{ |
+ m_properties->purgeMemory(); |
+} |
+ |
DEFINE_TRACE_AFTER_DISPATCH(StyleRulePage) |
{ |
visitor->trace(m_properties); |
@@ -335,6 +386,11 @@ MutableStylePropertySet& StyleRuleFontFace::mutableProperties() |
return *toMutableStylePropertySet(m_properties); |
} |
+void StyleRuleFontFace::purgeMemory() |
+{ |
+ m_properties->purgeMemory(); |
+} |
+ |
DEFINE_TRACE_AFTER_DISPATCH(StyleRuleFontFace) |
{ |
visitor->trace(m_properties); |
@@ -365,6 +421,12 @@ void StyleRuleGroup::wrapperRemoveRule(unsigned index) |
m_childRules.remove(index); |
} |
+void StyleRuleGroup::purgeMemory() |
+{ |
+ for (StyleRuleBase* childRule : m_childRules) |
+ childRule->purgeMemory(); |
+} |
+ |
DEFINE_TRACE_AFTER_DISPATCH(StyleRuleGroup) |
{ |
visitor->trace(m_childRules); |
@@ -427,6 +489,11 @@ MutableStylePropertySet& StyleRuleViewport::mutableProperties() |
return *toMutableStylePropertySet(m_properties); |
} |
+void StyleRuleViewport::purgeMemory() |
+{ |
+ m_properties->purgeMemory(); |
+} |
+ |
DEFINE_TRACE_AFTER_DISPATCH(StyleRuleViewport) |
{ |
visitor->trace(m_properties); |