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

Unified Diff: third_party/WebKit/Source/core/css/StyleRule.h

Issue 2282303002: [test] lazily parse css style rules
Patch Set: use string pool 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/StyleRule.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/StyleRule.h
diff --git a/third_party/WebKit/Source/core/css/StyleRule.h b/third_party/WebKit/Source/core/css/StyleRule.h
index f7098ecadac418056cfe9af359b134ddbb27045a..b2e432f149a03e0ba19188ff0b85e035486990ab 100644
--- a/third_party/WebKit/Source/core/css/StyleRule.h
+++ b/third_party/WebKit/Source/core/css/StyleRule.h
@@ -26,6 +26,7 @@
#include "core/css/CSSSelectorList.h"
#include "core/css/MediaList.h"
#include "core/css/StylePropertySet.h"
+#include "core/css/parser/CSSParserTokenRange.h"
#include "platform/heap/Handle.h"
#include "wtf/RefPtr.h"
@@ -97,11 +98,15 @@ public:
{
return new StyleRule(std::move(selectorList), properties);
}
+ static StyleRule* createLazy(CSSSelectorList selectorList, CSSParserTokenRange tokens, const CSSParserContext* context)
+ {
+ return new StyleRule(std::move(selectorList), tokens, context);
+ }
~StyleRule();
const CSSSelectorList& selectorList() const { return m_selectorList; }
- const StylePropertySet& properties() const { return *m_properties; }
+ const StylePropertySet& properties() const;
MutableStylePropertySet& mutableProperties();
void wrapperAdoptSelectorList(CSSSelectorList selectors) { m_selectorList = std::move(selectors); }
@@ -114,10 +119,14 @@ public:
private:
StyleRule(CSSSelectorList, StylePropertySet*);
+ StyleRule(CSSSelectorList, CSSParserTokenRange block, const CSSParserContext*);
StyleRule(const StyleRule&);
- Member<StylePropertySet> m_properties; // Cannot be null.
CSSSelectorList m_selectorList;
+
+ mutable Member<StylePropertySet> m_properties;
+ mutable Vector<CSSParserToken> m_lazyTokens;
+ const CSSParserContext* m_context;
};
class StyleRuleFontFace : public StyleRuleBase {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/StyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698