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

Unified Diff: third_party/WebKit/Source/core/dom/StyleEngine.cpp

Issue 1658923004: PurgeMemory. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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/dom/StyleEngine.cpp
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.cpp b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
index 65d35a495c2bea315b815a173f321f985edba6f6..0a019eb29f34e52f661022f9e00a30cb60c982af 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.cpp
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.cpp
@@ -724,6 +724,18 @@ void StyleEngine::setStatsEnabled(bool enabled)
m_styleResolverStats->reset();
}
+void StyleEngine::purgeMemory(DeviceKind deviceKind)
+{
+ if (m_documentStyleSheetCollection)
+ m_documentStyleSheetCollection->purgeMemory();
+ for (ShadowTreeStyleSheetCollection* collection : m_styleSheetCollectionMap.values())
+ collection->purgeMemory();
+ clearFontCache();
+ clearResolver();
+ m_textToSheetCache.clear();
+ m_sheetToTextCache.clear();
+}
+
DEFINE_TRACE(StyleEngine)
{
#if ENABLE(OILPAN)
« no previous file with comments | « third_party/WebKit/Source/core/dom/StyleEngine.h ('k') | third_party/WebKit/Source/core/dom/StyleSheetCollection.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698