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

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

Issue 2315923002: Lazy Parse CSS (Closed)
Patch Set: esprehn review Created 4 years, 1 month 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
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"
(...skipping 17 matching lines...) Expand all
28 class CORE_EXPORT Scope { 28 class CORE_EXPORT Scope {
29 DISALLOW_NEW(); 29 DISALLOW_NEW();
30 30
31 public: 31 public:
32 Scope(const String&); 32 Scope(const String&);
33 Scope(const String&, CSSParserObserverWrapper&); // For the inspector 33 Scope(const String&, CSSParserObserverWrapper&); // For the inspector
34 34
35 CSSParserTokenRange tokenRange(); 35 CSSParserTokenRange tokenRange();
36 unsigned tokenCount(); 36 unsigned tokenCount();
37 37
38 Vector<String> takeEscapedStrings() { return std::move(m_stringPool); }
39
38 private: 40 private:
39 void storeString(const String& string) { m_stringPool.append(string); } 41 void storeString(const String& string) { m_stringPool.append(string); }
40 Vector<CSSParserToken, 32> m_tokens; 42 Vector<CSSParserToken, 32> m_tokens;
41 // We only allocate strings when escapes are used. 43 // We only allocate strings when escapes are used.
42 Vector<String> m_stringPool; 44 Vector<String> m_stringPool;
43 String m_string; 45 String m_string;
44 46
45 friend class CSSTokenizer; 47 friend class CSSTokenizer;
46 }; 48 };
47 49
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 static const CodePoint codePoints[]; 116 static const CodePoint codePoints[];
115 117
116 Vector<CSSParserTokenType, 8> m_blockStack; 118 Vector<CSSParserTokenType, 8> m_blockStack;
117 CSSTokenizerInputStream& m_input; 119 CSSTokenizerInputStream& m_input;
118 Scope& m_scope; 120 Scope& m_scope;
119 }; 121 };
120 122
121 } // namespace blink 123 } // namespace blink
122 124
123 #endif // CSSTokenizer_h 125 #endif // CSSTokenizer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698