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

Side by Side Diff: third_party/WebKit/Source/core/css/parser/CSSTokenizer.h

Issue 1192983003: CSS Custom Properties (Variables) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Post-merge Created 5 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/Allocator.h"
12 #include "wtf/text/WTFString.h" 12 #include "wtf/text/WTFString.h"
13 13
14 #include <climits> 14 #include <climits>
15 15
16 namespace blink { 16 namespace blink {
17 17
18 class CSSTokenizerInputStream; 18 class CSSTokenizerInputStream;
19 class CSSParserObserverWrapper; 19 class CSSParserObserverWrapper;
20 struct CSSParserString; 20 struct CSSParserString;
21 class CSSParserTokenRange; 21 class CSSParserTokenRange;
22 22
23 class CORE_EXPORT CSSTokenizer { 23 class CORE_EXPORT CSSTokenizer {
24 WTF_MAKE_NONCOPYABLE(CSSTokenizer);
Timothy Loh 2015/09/30 02:09:28 The changes in here and the .cpp don't seem releva
25 WTF_MAKE_FAST_ALLOCATED(CSSTokenizer); 24 WTF_MAKE_FAST_ALLOCATED(CSSTokenizer);
26 public: 25 public:
27 class CORE_EXPORT Scope { 26 class CORE_EXPORT Scope {
28 DISALLOW_ALLOCATION(); 27 DISALLOW_ALLOCATION();
29 public: 28 public:
30 Scope(const String&); 29 Scope(const String&);
31 Scope(const String&, CSSParserObserverWrapper&); // For the inspector 30 Scope(const String&, CSSParserObserverWrapper&); // For the inspector
32 31
33 CSSParserTokenRange tokenRange(); 32 CSSParserTokenRange tokenRange();
34 unsigned tokenCount(); 33 unsigned tokenCount();
35 34
36 private: 35 private:
37 void storeString(const String& string) { m_stringPool.append(string); } 36 void storeString(const String& string) { m_stringPool.append(string); }
38 Vector<CSSParserToken> m_tokens; 37 Vector<CSSParserToken> m_tokens;
39 // We only allocate strings when escapes are used. 38 // We only allocate strings when escapes are used.
40 Vector<String> m_stringPool; 39 Vector<String> m_stringPool;
41 String m_string; 40 String m_string;
42 41
43 friend class CSSTokenizer; 42 friend class CSSTokenizer;
44 }; 43 };
45
46 private: 44 private:
47 CSSTokenizer(CSSTokenizerInputStream&, Scope&); 45 CSSTokenizer(CSSTokenizerInputStream&, Scope&);
48 46
49 CSSParserToken nextToken(); 47 CSSParserToken nextToken();
50 48
51 UChar consume(); 49 UChar consume();
52 void consume(unsigned); 50 void consume(unsigned);
53 void reconsume(UChar); 51 void reconsume(UChar);
54 52
55 CSSParserToken consumeNumericToken(); 53 CSSParserToken consumeNumericToken();
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 112
115 CSSTokenizerInputStream& m_input; 113 CSSTokenizerInputStream& m_input;
116 Scope& m_scope; 114 Scope& m_scope;
117 }; 115 };
118 116
119 117
120 118
121 } // namespace blink 119 } // namespace blink
122 120
123 #endif // CSSTokenizer_h 121 #endif // CSSTokenizer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698