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

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

Issue 2289333003: CSS Lazy Parsing perf jobs (Closed)
Patch Set: CL for src perf tryjob to run blink_style.top_25 benchmark on all-android platform(s) Created 4 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: 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 1cfe952aee2ffaf2da6f2f76c598554c86f03136..d18c771877c488c43dd89595665cfa6a6bada66f 100644
--- a/third_party/WebKit/Source/core/css/StyleRule.h
+++ b/third_party/WebKit/Source/core/css/StyleRule.h
@@ -99,11 +99,17 @@ class CORE_EXPORT StyleRule : public StyleRuleBase {
StylePropertySet* properties) {
return new StyleRule(std::move(selectorList), properties);
}
+ static StyleRule* createLazy(
+ CSSSelectorList selectorList,
+ std::unique_ptr<DeferredPropertiesClosure> deferredProperties) {
+ return new StyleRule(std::move(selectorList),
+ std::move(deferredProperties));
+ }
~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) {
@@ -114,14 +120,20 @@ class CORE_EXPORT StyleRule : public StyleRuleBase {
static unsigned averageSizeInBytes();
+ // Helper methods to avoid parsing lazy properties when not needed.
+ bool propertiesHaveFailedOrCanceledSubresources() const;
+ bool shouldConsiderForMatchingRules(bool includeEmptyRules) const;
+
DECLARE_TRACE_AFTER_DISPATCH();
private:
StyleRule(CSSSelectorList, StylePropertySet*);
+ StyleRule(CSSSelectorList, std::unique_ptr<DeferredPropertiesClosure>);
StyleRule(const StyleRule&);
- Member<StylePropertySet> m_properties; // Cannot be null.
CSSSelectorList m_selectorList;
+ mutable Member<StylePropertySet> m_properties;
+ mutable std::unique_ptr<DeferredPropertiesClosure> m_deferred;
};
class StyleRuleFontFace : public StyleRuleBase {
« no previous file with comments | « third_party/WebKit/Source/core/css/StylePropertySet.h ('k') | third_party/WebKit/Source/core/css/StyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698