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

Unified Diff: Source/core/css/CSSTokenizer.h

Issue 196353018: Smaller CSSParser UTF16 buffers for escaped strings. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rewrote comments. Created 6 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/core/css/CSSTokenizer-in.cpp » ('j') | Source/core/css/CSSTokenizer-in.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/CSSTokenizer.h
diff --git a/Source/core/css/CSSTokenizer.h b/Source/core/css/CSSTokenizer.h
index 5d8fae12e7f2bb08845b13c100431a4ce12411da..05356b5fda378e72212760d65173190a07fa2005 100644
--- a/Source/core/css/CSSTokenizer.h
+++ b/Source/core/css/CSSTokenizer.h
@@ -74,7 +74,7 @@ public:
inline unsigned tokenStartOffset();
private:
- UChar*& currentCharacter16();
+ UChar* getStringBuffer16(size_t len);
template <typename CharacterType>
inline CharacterType*& currentCharacter();
@@ -92,29 +92,33 @@ private:
inline CSSParserLocation tokenLocation();
template <typename CharacterType>
- unsigned parseEscape(CharacterType*&);
+ static unsigned parseEscape(CharacterType*&);
template <typename DestCharacterType>
- inline void UnicodeToChars(DestCharacterType*&, unsigned);
- template <typename SrcCharacterType, typename DestCharacterType>
- inline bool parseIdentifierInternal(SrcCharacterType*&, DestCharacterType*&, bool&);
+ static inline void UnicodeToChars(DestCharacterType*&, unsigned);
+ template <typename SrcCharacterType, typename DestCharacterType>
+ static inline bool parseIdentifierInternal(SrcCharacterType*&, DestCharacterType*&, bool&);
+ template <typename SrcCharacterType>
+ static size_t peekMaxIdentifierLen(SrcCharacterType*);
template <typename CharacterType>
inline void parseIdentifier(CharacterType*&, CSSParserString&, bool&);
+ template <typename SrcCharacterType>
+ static size_t peekMaxStringLen(SrcCharacterType*, UChar quote);
template <typename SrcCharacterType, typename DestCharacterType>
- inline bool parseStringInternal(SrcCharacterType*&, DestCharacterType*&, UChar);
-
+ static inline bool parseStringInternal(SrcCharacterType*&, DestCharacterType*&, UChar);
template <typename CharacterType>
inline void parseString(CharacterType*&, CSSParserString& resultString, UChar);
template <typename CharacterType>
inline bool findURI(CharacterType*& start, CharacterType*& end, UChar& quote);
-
+ template <typename SrcCharacterType>
+ static size_t peekMaxURILen(SrcCharacterType*, UChar quote);
template <typename SrcCharacterType, typename DestCharacterType>
- inline bool parseURIInternal(SrcCharacterType*&, DestCharacterType*&, UChar quote);
-
+ static inline bool parseURIInternal(SrcCharacterType*&, DestCharacterType*&, UChar quote);
template <typename CharacterType>
inline void parseURI(CSSParserString&);
+
template <typename CharacterType>
inline bool parseUnicodeRange();
template <typename CharacterType>
@@ -155,6 +159,7 @@ private:
OwnPtr<UChar[]> m_dataStart16;
LChar* m_currentCharacter8;
UChar* m_currentCharacter16;
+ Vector<OwnPtr<UChar[]> > m_cssStrings16;
Julien - ping for review 2014/03/20 20:57:39 Really not a huge fan of the Vector approach but w
Daniel Bratell 2014/03/21 15:14:39 Done. - Though I wouldn't call it giant. It will b
Julien - ping for review 2014/03/21 17:56:26 I meant giant *hack* Vector but forgot one word. I
union {
LChar* ptr8;
UChar* ptr16;
« no previous file with comments | « no previous file | Source/core/css/CSSTokenizer-in.cpp » ('j') | Source/core/css/CSSTokenizer-in.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698