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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.h

Issue 2474483002: [LazyParseCSS] Ensure UseCounting has parity with strict parsing (Closed)
Patch Set: Add StyleSheetContents::anyOwnerDocument() Created 4 years 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/parser/CSSLazyParsingState.h
diff --git a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.h b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.h
index 3234141f9e8102319f61a3445b02234ad56bf2a3..c481f9a6d26ed61766c44002ad9e2e6037e30263 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.h
+++ b/third_party/WebKit/Source/core/css/parser/CSSLazyParsingState.h
@@ -31,7 +31,7 @@ class CSSLazyParsingState
bool shouldLazilyParseProperties(const CSSSelectorList&,
const CSSParserTokenRange& block);
- DEFINE_INLINE_TRACE() { visitor->trace(m_owningContents); }
+ DECLARE_TRACE();
private:
CSSParserContext m_context;
@@ -42,6 +42,10 @@ class CSSLazyParsingState
// Weak to ensure lazy state will never cause the contents to live longer than
// it should (we DCHECK this fact).
WeakMember<StyleSheetContents> m_owningContents;
+
+ // Cache the document as a proxy for caching the UseCounter. Grabbing the
+ // UseCounter per every property parse is a bit more expensive.
+ WeakMember<Document> m_document;
};
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698