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

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

Issue 192473003: Move CSSRuleList to the garbage collected heap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: ager feedback Created 6 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/dom/DocumentStyleSheetCollector.cpp ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/StyleEngine.h
diff --git a/Source/core/dom/StyleEngine.h b/Source/core/dom/StyleEngine.h
index 083b91dc3c31805809992b2ab35f0f05fa07d7cb..34dc5fb2779e38f12a1d35420049f81f4bf0b2c0 100644
--- a/Source/core/dom/StyleEngine.h
+++ b/Source/core/dom/StyleEngine.h
@@ -71,8 +71,8 @@ private:
bool m_needsStyleRecalc;
};
-class StyleEngine {
- WTF_MAKE_FAST_ALLOCATED;
+class StyleEngine : public NoBaseWillBeGarbageCollectedFinalized<StyleEngine> {
+ WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED;
public:
class IgnoringPendingStylesheet : public TemporaryChange<bool> {
@@ -85,17 +85,19 @@ public:
friend class IgnoringPendingStylesheet;
- static PassOwnPtr<StyleEngine> create(Document& document) { return adoptPtr(new StyleEngine(document)); }
+ static PassOwnPtrWillBeRawPtr<StyleEngine> create(Document& document) { return adoptPtrWillBeNoop(new StyleEngine(document)); }
~StyleEngine();
- const Vector<RefPtr<StyleSheet> >& styleSheetsForStyleSheetList(TreeScope&);
- const Vector<RefPtr<CSSStyleSheet> >& activeAuthorStyleSheets() const;
+ void detachFromDocument();
- const Vector<RefPtr<CSSStyleSheet> >& documentAuthorStyleSheets() const { return m_authorStyleSheets; }
- const Vector<RefPtr<CSSStyleSheet> >& injectedAuthorStyleSheets() const;
+ const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> >& styleSheetsForStyleSheetList(TreeScope&);
+ const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& activeAuthorStyleSheets() const;
- const Vector<RefPtr<StyleSheet> > activeStyleSheetsForInspector() const;
+ const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& documentAuthorStyleSheets() const { return m_authorStyleSheets; }
+ const WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> >& injectedAuthorStyleSheets() const;
+
+ const WillBeHeapVector<RefPtrWillBeMember<StyleSheet> > activeStyleSheetsForInspector() const;
void modifiedStyleSheet(StyleSheet*);
void addStyleSheetCandidateNode(Node*, bool createdByParser);
@@ -184,6 +186,8 @@ public:
static PassRefPtr<CSSStyleSheet> createSheet(Element*, const String& text, TextPosition startPosition, bool createdByParser);
static void removeSheet(StyleSheetContents*);
+ void trace(Visitor*);
+
private:
StyleEngine(Document&);
@@ -216,10 +220,10 @@ private:
// elements and when it is safe to execute scripts.
int m_pendingStylesheets;
- mutable Vector<RefPtr<CSSStyleSheet> > m_injectedAuthorStyleSheets;
+ mutable WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > m_injectedAuthorStyleSheets;
mutable bool m_injectedStyleSheetCacheValid;
- Vector<RefPtr<CSSStyleSheet> > m_authorStyleSheets;
+ WillBeHeapVector<RefPtrWillBeMember<CSSStyleSheet> > m_authorStyleSheets;
DocumentStyleSheetCollection m_documentStyleSheetCollection;
HashMap<TreeScope*, OwnPtr<TreeScopeStyleSheetCollection> > m_styleSheetCollectionMap;
« no previous file with comments | « Source/core/dom/DocumentStyleSheetCollector.cpp ('k') | Source/core/dom/StyleEngine.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698