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

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

Issue 2282303002: [test] lazily parse css style rules
Patch Set: use string pool Created 4 years, 3 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
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 15 matching lines...) Expand all
26 public: 26 public:
27 class CORE_EXPORT Scope { 27 class CORE_EXPORT Scope {
28 DISALLOW_NEW(); 28 DISALLOW_NEW();
29 public: 29 public:
30 Scope(const String&); 30 Scope(const String&);
31 Scope(const String&, CSSParserObserverWrapper&); // For the inspector 31 Scope(const String&, CSSParserObserverWrapper&); // For the inspector
32 32
33 CSSParserTokenRange tokenRange(); 33 CSSParserTokenRange tokenRange();
34 unsigned tokenCount(); 34 unsigned tokenCount();
35 35
36 const Vector<String>& stringPool()
37 {
38 return m_stringPool;
39 }
40
36 private: 41 private:
37 void storeString(const String& string) { m_stringPool.append(string); } 42 void storeString(const String& string) { m_stringPool.append(string); }
38 Vector<CSSParserToken, 32> m_tokens; 43 Vector<CSSParserToken, 32> m_tokens;
39 // We only allocate strings when escapes are used. 44 // We only allocate strings when escapes are used.
40 Vector<String> m_stringPool; 45 Vector<String> m_stringPool;
41 String m_string; 46 String m_string;
42 47
43 friend class CSSTokenizer; 48 friend class CSSTokenizer;
44 }; 49 };
45 50
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 Vector<CSSParserTokenType, 8> m_blockStack; 117 Vector<CSSParserTokenType, 8> m_blockStack;
113 CSSTokenizerInputStream& m_input; 118 CSSTokenizerInputStream& m_input;
114 Scope& m_scope; 119 Scope& m_scope;
115 }; 120 };
116 121
117 122
118 123
119 } // namespace blink 124 } // namespace blink
120 125
121 #endif // CSSTokenizer_h 126 #endif // CSSTokenizer_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698