Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(894)

Unified Diff: Source/core/layout/svg/LayoutSVGResourceFilter.cpp

Issue 1010673005: Oilpan: promptly release FilterData on LayoutSVGResourceFilter destruction (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceFilter.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/layout/svg/LayoutSVGResourceFilter.cpp
diff --git a/Source/core/layout/svg/LayoutSVGResourceFilter.cpp b/Source/core/layout/svg/LayoutSVGResourceFilter.cpp
index af4b67aaadb9d19c28c49882669b336269ef69db..01bb436b4544a3cdaf1608c1b8b23df7f48abdfd 100644
--- a/Source/core/layout/svg/LayoutSVGResourceFilter.cpp
+++ b/Source/core/layout/svg/LayoutSVGResourceFilter.cpp
@@ -41,6 +41,14 @@ DEFINE_TRACE(FilterData)
#endif
}
+void FilterData::dispose()
+{
+ m_context.clear();
+ m_displayItemList.clear();
+ builder = nullptr;
+ filter = nullptr;
+}
+
LayoutSVGResourceFilter::LayoutSVGResourceFilter(SVGFilterElement* node)
: LayoutSVGResourceContainer(node)
{
@@ -50,9 +58,18 @@ LayoutSVGResourceFilter::~LayoutSVGResourceFilter()
{
}
-void LayoutSVGResourceFilter::destroy()
+void LayoutSVGResourceFilter::disposeFilterMap()
{
+#if ENABLE(OILPAN)
+ for (auto& filter : m_filter)
+ filter.value->dispose();
+#endif
m_filter.clear();
+}
+
+void LayoutSVGResourceFilter::destroy()
+{
+ disposeFilterMap();
LayoutSVGResourceContainer::destroy();
}
@@ -63,7 +80,7 @@ bool LayoutSVGResourceFilter::isChildAllowed(LayoutObject* child, const LayoutSt
void LayoutSVGResourceFilter::removeAllClientsFromCache(bool markForInvalidation)
{
- m_filter.clear();
+ disposeFilterMap();
markAllClientsForInvalidation(markForInvalidation ? LayoutAndBoundariesInvalidation : ParentOnlyInvalidation);
}
@@ -115,7 +132,7 @@ void LayoutSVGResourceFilter::primitiveAttributeChanged(LayoutObject* object, co
{
FilterMap::iterator it = m_filter.begin();
FilterMap::iterator end = m_filter.end();
- SVGFilterPrimitiveStandardAttributes* primitve = static_cast<SVGFilterPrimitiveStandardAttributes*>(object->node());
+ SVGFilterPrimitiveStandardAttributes* primitive = static_cast<SVGFilterPrimitiveStandardAttributes*>(object->node());
for (; it != end; ++it) {
FilterData* filterData = it->value.get();
@@ -128,7 +145,7 @@ void LayoutSVGResourceFilter::primitiveAttributeChanged(LayoutObject* object, co
continue;
// Since all effects shares the same attribute value, all
// or none of them will be changed.
- if (!primitve->setFilterEffectAttribute(effect, attribute))
+ if (!primitive->setFilterEffectAttribute(effect, attribute))
return;
builder->clearResultsRecursive(effect);
@@ -138,4 +155,4 @@ void LayoutSVGResourceFilter::primitiveAttributeChanged(LayoutObject* object, co
markAllClientLayersForInvalidation();
}
-}
+} // namespace blink
« no previous file with comments | « Source/core/layout/svg/LayoutSVGResourceFilter.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698