| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CSSLazyParsingState_h |
| 6 #define CSSLazyParsingState_h |
| 7 |
| 8 #include "core/css/CSSSelectorList.h" |
| 9 #include "core/css/parser/CSSParserMode.h" |
| 10 #include "wtf/Vector.h" |
| 11 #include "wtf/text/WTFString.h" |
| 12 |
| 13 namespace blink { |
| 14 |
| 15 // This class helps lazy parsing by retaining necessary state. It should not |
| 16 // outlive the StyleSheetContents that initiated the parse, as it retains a raw |
| 17 // reference to the UseCounter associated with the style sheet. |
| 18 class CSSLazyParsingState |
| 19 : public GarbageCollectedFinalized<CSSLazyParsingState> { |
| 20 public: |
| 21 CSSLazyParsingState(const CSSParserContext&, |
| 22 Vector<String> escapedStrings, |
| 23 const String& sheetText); |
| 24 |
| 25 // This should be a copy of the context used in CSSParser::parseSheet. |
| 26 const CSSParserContext& context() { return m_context; } |
| 27 |
| 28 bool shouldLazilyParseProperties(const CSSSelectorList&); |
| 29 |
| 30 DEFINE_INLINE_TRACE() {} |
| 31 |
| 32 private: |
| 33 CSSParserContext m_context; |
| 34 Vector<String> m_escapedStrings; |
| 35 // Also referenced on the css resource. |
| 36 String m_sheetText; |
| 37 }; |
| 38 |
| 39 } // namespace blink |
| 40 |
| 41 #endif // CSSLazyParsingState_h |
| OLD | NEW |