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

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

Issue 28553005: Avoid parsing css text if there are identical inline style blocks. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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: Source/core/dom/StyleEngine.h
diff --git a/Source/core/dom/StyleEngine.h b/Source/core/dom/StyleEngine.h
index 2c70a5b0d150107b4e0c705204e39886ae2aa23c..7851ef946b3ff49dffeb05f2e4c95d85c2b590bc 100644
--- a/Source/core/dom/StyleEngine.h
+++ b/Source/core/dom/StyleEngine.h
@@ -35,6 +35,7 @@
#include "wtf/ListHashSet.h"
#include "wtf/RefPtr.h"
#include "wtf/Vector.h"
+#include "wtf/text/AtomicString.h"
#include "wtf/text/WTFString.h"
namespace WebCore {
@@ -110,6 +111,11 @@ public:
void appendActiveAuthorStyleSheets(StyleResolver*);
void getActiveAuthorStyleSheets(Vector<const Vector<RefPtr<CSSStyleSheet> >*>& activeAuthorStyleSheets) const;
+ // CSSStyleContents cache.
+ StyleSheetContents* findStyleSheetContents(const AtomicString&);
+ void registerStyleSheetContents(const AtomicString&, StyleSheetContents*);
+ void unregisterStyleSheetContents(const AtomicString&);
+
private:
StyleEngine(Document&);
@@ -154,6 +160,9 @@ private:
bool m_usesFirstLineRules;
bool m_usesFirstLetterRules;
bool m_usesRemUnits;
+
+ // Mapping from textContents of StyleElement to a pair of StyleSheetContent(second) and its usages(first).
dglazkov 2013/10/18 16:56:19 Can we move this into a separate class, which is c
tasak 2013/10/21 12:27:37 Done.
+ HashMap<AtomicString, std::pair<unsigned, RefPtr<StyleSheetContents> > > m_styleSheetContentsCache;
};
}

Powered by Google App Engine
This is Rietveld 408576698