| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSLazyParsingState_h | 5 #ifndef CSSLazyParsingState_h |
| 6 #define CSSLazyParsingState_h | 6 #define CSSLazyParsingState_h |
| 7 | 7 |
| 8 #include "core/css/CSSSelectorList.h" | 8 #include "core/css/CSSSelectorList.h" |
| 9 #include "core/css/StyleSheetContents.h" | 9 #include "core/css/StyleSheetContents.h" |
| 10 #include "core/css/parser/CSSParserMode.h" | 10 #include "core/css/parser/CSSParserMode.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 CSSLazyParsingState(const CSSParserContext&, | 24 CSSLazyParsingState(const CSSParserContext&, |
| 25 Vector<String> escapedStrings, | 25 Vector<String> escapedStrings, |
| 26 const String& sheetText, | 26 const String& sheetText, |
| 27 StyleSheetContents*); | 27 StyleSheetContents*); |
| 28 | 28 |
| 29 const CSSParserContext& context(); | 29 const CSSParserContext& context(); |
| 30 | 30 |
| 31 bool shouldLazilyParseProperties(const CSSSelectorList&, | 31 bool shouldLazilyParseProperties(const CSSSelectorList&, |
| 32 const CSSParserTokenRange& block); | 32 const CSSParserTokenRange& block); |
| 33 | 33 |
| 34 DEFINE_INLINE_TRACE() { visitor->trace(m_owningContents); } | 34 DECLARE_TRACE(); |
| 35 | 35 |
| 36 private: | 36 private: |
| 37 CSSParserContext m_context; | 37 CSSParserContext m_context; |
| 38 Vector<String> m_escapedStrings; | 38 Vector<String> m_escapedStrings; |
| 39 // Also referenced on the css resource. | 39 // Also referenced on the css resource. |
| 40 String m_sheetText; | 40 String m_sheetText; |
| 41 | 41 |
| 42 // Weak to ensure lazy state will never cause the contents to live longer than | 42 // Weak to ensure lazy state will never cause the contents to live longer than |
| 43 // it should (we DCHECK this fact). | 43 // it should (we DCHECK this fact). |
| 44 WeakMember<StyleSheetContents> m_owningContents; | 44 WeakMember<StyleSheetContents> m_owningContents; |
| 45 |
| 46 // Cache the document as a proxy for caching the UseCounter. Grabbing the |
| 47 // UseCounter per every property parse is a bit more expensive. |
| 48 WeakMember<Document> m_document; |
| 45 }; | 49 }; |
| 46 | 50 |
| 47 } // namespace blink | 51 } // namespace blink |
| 48 | 52 |
| 49 #endif // CSSLazyParsingState_h | 53 #endif // CSSLazyParsingState_h |
| OLD | NEW |