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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All r ights reserved.
7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/) 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t orchmobile.com/)
8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
9 * Copyright (C) 2011 Google Inc. All rights reserved. 9 * Copyright (C) 2011 Google Inc. All rights reserved.
10 * 10 *
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 void removeFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&) ; 155 void removeFontFaceRules(const HeapVector<Member<const StyleRuleFontFace>>&) ;
156 void clearFontCache(); 156 void clearFontCache();
157 // updateGenericFontFamilySettings is used from WebSettingsImpl. 157 // updateGenericFontFamilySettings is used from WebSettingsImpl.
158 void updateGenericFontFamilySettings(); 158 void updateGenericFontFamilySettings();
159 159
160 void didDetach(); 160 void didDetach();
161 bool shouldClearResolver() const; 161 bool shouldClearResolver() const;
162 void resolverChanged(StyleResolverUpdateMode); 162 void resolverChanged(StyleResolverUpdateMode);
163 163
164 CSSStyleSheet* createSheet(Element*, const String& text, TextPosition startP osition, StyleEngineContext&); 164 CSSStyleSheet* createSheet(Element*, const String& text, TextPosition startP osition, StyleEngineContext&);
165 void removeSheet(StyleSheetContents*);
166 165
167 void collectScopedStyleFeaturesTo(RuleFeatureSet&) const; 166 void collectScopedStyleFeaturesTo(RuleFeatureSet&) const;
168 void ensureFullscreenUAStyle(); 167 void ensureFullscreenUAStyle();
169 168
170 void platformColorsChanged(); 169 void platformColorsChanged();
171 170
172 void classChangedForElement(const SpaceSplitString& changedClasses, Element& ); 171 void classChangedForElement(const SpaceSplitString& changedClasses, Element& );
173 void classChangedForElement(const SpaceSplitString& oldClasses, const SpaceS plitString& newClasses, Element&); 172 void classChangedForElement(const SpaceSplitString& oldClasses, const SpaceS plitString& newClasses, Element&);
174 void attributeChangedForElement(const QualifiedName& attributeName, Element& ); 173 void attributeChangedForElement(const QualifiedName& attributeName, Element& );
175 void idChangedForElement(const AtomicString& oldId, const AtomicString& newI d, Element&); 174 void idChangedForElement(const AtomicString& oldId, const AtomicString& newI d, Element&);
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 259
261 bool m_ignorePendingStylesheets = false; 260 bool m_ignorePendingStylesheets = false;
262 bool m_didCalculateResolver = false; 261 bool m_didCalculateResolver = false;
263 bool m_hasUnresolvedKeyframesRule = false; 262 bool m_hasUnresolvedKeyframesRule = false;
264 263
265 Member<StyleResolver> m_resolver; 264 Member<StyleResolver> m_resolver;
266 StyleInvalidator m_styleInvalidator; 265 StyleInvalidator m_styleInvalidator;
267 266
268 Member<CSSFontSelector> m_fontSelector; 267 Member<CSSFontSelector> m_fontSelector;
269 268
270 HeapHashMap<AtomicString, Member<StyleSheetContents>> m_textToSheetCache; 269 HeapHashMap<AtomicString, WeakMember<StyleSheetContents>> m_textToSheetCache ;
271 HeapHashMap<Member<StyleSheetContents>, AtomicString> m_sheetToTextCache; 270 HeapHashMap<WeakMember<StyleSheetContents>, AtomicString> m_sheetToTextCache ;
272 271
273 std::unique_ptr<StyleResolverStats> m_styleResolverStats; 272 std::unique_ptr<StyleResolverStats> m_styleResolverStats;
274 unsigned m_styleForElementCount = 0; 273 unsigned m_styleForElementCount = 0;
275 274
276 friend class StyleEngineTest; 275 friend class StyleEngineTest;
277 }; 276 };
278 277
279 } // namespace blink 278 } // namespace blink
280 279
281 #endif 280 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698