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

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

Issue 2205843003: Use weak members to cache StyleSheetContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Might be in cache without being used before garbage collection Created 4 years, 4 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.h
diff --git a/third_party/WebKit/Source/core/dom/StyleEngine.h b/third_party/WebKit/Source/core/dom/StyleEngine.h
index 1ff4b284b27257a323a66bf6328ede12bf7c6467..9cf5148493f656f5e368e8497435b3c491837327 100644
--- a/third_party/WebKit/Source/core/dom/StyleEngine.h
+++ b/third_party/WebKit/Source/core/dom/StyleEngine.h
@@ -162,7 +162,6 @@ public:
void resolverChanged(StyleResolverUpdateMode);
CSSStyleSheet* createSheet(Element*, const String& text, TextPosition startPosition, StyleEngineContext&);
- void removeSheet(StyleSheetContents*);
void collectScopedStyleFeaturesTo(RuleFeatureSet&) const;
void ensureFullscreenUAStyle();
@@ -267,8 +266,8 @@ private:
Member<CSSFontSelector> m_fontSelector;
- HeapHashMap<AtomicString, Member<StyleSheetContents>> m_textToSheetCache;
- HeapHashMap<Member<StyleSheetContents>, AtomicString> m_sheetToTextCache;
+ HeapHashMap<AtomicString, WeakMember<StyleSheetContents>> m_textToSheetCache;
+ HeapHashMap<WeakMember<StyleSheetContents>, AtomicString> m_sheetToTextCache;
std::unique_ptr<StyleResolverStats> m_styleResolverStats;
unsigned m_styleForElementCount = 0;

Powered by Google App Engine
This is Rietveld 408576698