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

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

Issue 2058403002: Use an inline capacity for CSSTokenizer's Vector<CSSParserToken> (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserTokenRange.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 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 private: 36 private:
37 void storeString(const String& string) { m_stringPool.append(string); } 37 void storeString(const String& string) { m_stringPool.append(string); }
38 Vector<CSSParserToken> m_tokens; 38 Vector<CSSParserToken, 32> m_tokens;
39 // We only allocate strings when escapes are used. 39 // We only allocate strings when escapes are used.
40 Vector<String> m_stringPool; 40 Vector<String> m_stringPool;
41 String m_string; 41 String m_string;
42 42
43 friend class CSSTokenizer; 43 friend class CSSTokenizer;
44 }; 44 };
45 45
46 private: 46 private:
47 CSSTokenizer(CSSTokenizerInputStream&, Scope&); 47 CSSTokenizer(CSSTokenizerInputStream&, Scope&);
48 48
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 114
115 CSSTokenizerInputStream& m_input; 115 CSSTokenizerInputStream& m_input;
116 Scope& m_scope; 116 Scope& m_scope;
117 }; 117 };
118 118
119 119
120 120
121 } // namespace blink 121 } // namespace blink
122 122
123 #endif // CSSTokenizer_h 123 #endif // CSSTokenizer_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserTokenRange.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698