OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 CSSTokenizer_h | 5 #ifndef CSSTokenizer_h |
6 #define CSSTokenizer_h | 6 #define CSSTokenizer_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/css/parser/CSSParserToken.h" | 9 #include "core/css/parser/CSSParserToken.h" |
10 #include "core/html/parser/InputStreamPreprocessor.h" | 10 #include "core/html/parser/InputStreamPreprocessor.h" |
| 11 #include "wtf/Allocator.h" |
11 #include "wtf/text/WTFString.h" | 12 #include "wtf/text/WTFString.h" |
12 | 13 |
13 #include <climits> | 14 #include <climits> |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 class CSSTokenizerInputStream; | 18 class CSSTokenizerInputStream; |
18 class CSSParserObserverWrapper; | 19 class CSSParserObserverWrapper; |
19 struct CSSParserString; | 20 struct CSSParserString; |
20 class CSSParserTokenRange; | 21 class CSSParserTokenRange; |
21 | 22 |
22 class CORE_EXPORT CSSTokenizer { | 23 class CORE_EXPORT CSSTokenizer { |
23 WTF_MAKE_NONCOPYABLE(CSSTokenizer); | 24 WTF_MAKE_NONCOPYABLE(CSSTokenizer); |
24 WTF_MAKE_FAST_ALLOCATED(CSSTokenizer); | 25 WTF_MAKE_FAST_ALLOCATED(CSSTokenizer); |
25 public: | 26 public: |
26 class CORE_EXPORT Scope { | 27 class CORE_EXPORT Scope { |
| 28 DISALLOW_ALLOCATION(); |
27 public: | 29 public: |
28 Scope(const String&); | 30 Scope(const String&); |
29 Scope(const String&, CSSParserObserverWrapper&); // For the inspector | 31 Scope(const String&, CSSParserObserverWrapper&); // For the inspector |
30 | 32 |
31 CSSParserTokenRange tokenRange(); | 33 CSSParserTokenRange tokenRange(); |
32 unsigned tokenCount(); | 34 unsigned tokenCount(); |
33 | 35 |
34 private: | 36 private: |
35 void storeString(const String& string) { m_stringPool.append(string); } | 37 void storeString(const String& string) { m_stringPool.append(string); } |
36 Vector<CSSParserToken> m_tokens; | 38 Vector<CSSParserToken> m_tokens; |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 114 |
113 CSSTokenizerInputStream& m_input; | 115 CSSTokenizerInputStream& m_input; |
114 Scope& m_scope; | 116 Scope& m_scope; |
115 }; | 117 }; |
116 | 118 |
117 | 119 |
118 | 120 |
119 } // namespace blink | 121 } // namespace blink |
120 | 122 |
121 #endif // CSSTokenizer_h | 123 #endif // CSSTokenizer_h |
OLD | NEW |