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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp

Issue 1382353002: Oilpan: promptly dispose style resolvers upon clearing. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Only expose dispose()s to Oilpan Created 5 years, 2 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
Index: third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
index dd1ec1e8d8c81e2fb8b27cf5a7c3c0f4fc475fc0..a6610a0272c12f7eff39a30335f7c19bd5466f1b 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleResolver.cpp
@@ -163,6 +163,27 @@ StyleResolver::~StyleResolver()
{
}
+#if ENABLE(OILPAN)
+void StyleResolver::dispose()
+{
+ m_features.clear();
+ if (m_siblingRuleSet) {
+ m_siblingRuleSet->dispose();
+ m_siblingRuleSet.clear();
+ }
+ if (m_uncommonAttributeRuleSet) {
+ m_uncommonAttributeRuleSet->dispose();
+ m_uncommonAttributeRuleSet.clear();
+ }
+ m_styleSharingLists.clear();
+ if (m_watchedSelectorsRules) {
+ m_watchedSelectorsRules->dispose();
+ m_watchedSelectorsRules.clear();
+ }
+ m_pendingStyleSheets.clear();
+}
+#endif
+
void StyleResolver::initWatchedSelectorRules()
{
CSSSelectorWatch* watch = CSSSelectorWatch::fromIfExists(*m_document);
@@ -1461,8 +1482,8 @@ void StyleResolver::computeFont(ComputedStyle* style, const StylePropertySet& pr
void StyleResolver::addMediaQueryResults(const MediaQueryResultList& list)
{
- for (size_t i = 0; i < list.size(); ++i)
- m_viewportDependentMediaQueryResults.append(list[i]);
+ if (list.size())
+ m_viewportDependentMediaQueryResults.appendVector(list);
}
bool StyleResolver::mediaQueryAffectedByViewportChange() const
« no previous file with comments | « third_party/WebKit/Source/core/css/resolver/StyleResolver.h ('k') | third_party/WebKit/Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698