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

Side by Side Diff: Source/platform/text/SegmentedString.h

Issue 1311043004: Revert of SegmentedString::push() should always push a char in front (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 2 Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
3 3
4 This library is free software; you can redistribute it and/or 4 This library is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public 5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either 6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version. 7 version 2 of the License, or (at your option) any later version.
8 8
9 This library is distributed in the hope that it will be useful, 9 This library is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of 10 but WITHOUT ANY WARRANTY; without even the implied warranty of
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 void close(); 183 void close();
184 184
185 void append(const SegmentedString&); 185 void append(const SegmentedString&);
186 void prepend(const SegmentedString&); 186 void prepend(const SegmentedString&);
187 187
188 bool excludeLineNumbers() const { return m_currentString.excludeLineNumbers( ); } 188 bool excludeLineNumbers() const { return m_currentString.excludeLineNumbers( ); }
189 void setExcludeLineNumbers(); 189 void setExcludeLineNumbers();
190 190
191 void push(UChar c) 191 void push(UChar c)
192 { 192 {
193 ASSERT(c);
194
195 if (!m_pushedChar1) { 193 if (!m_pushedChar1) {
196 m_currentChar = m_pushedChar1 = c; 194 m_pushedChar1 = c;
195 m_currentChar = m_pushedChar1 ? m_pushedChar1 : m_currentString.getC urrentChar();
197 updateSlowCaseFunctionPointers(); 196 updateSlowCaseFunctionPointers();
198 } else { 197 } else {
199 ASSERT(!m_pushedChar2); 198 ASSERT(!m_pushedChar2);
200 m_pushedChar2 = m_pushedChar1; 199 m_pushedChar2 = c;
201 m_currentChar = m_pushedChar1 = c;
202 } 200 }
203 } 201 }
204 202
205 bool isEmpty() const { return m_empty; } 203 bool isEmpty() const { return m_empty; }
206 unsigned length() const; 204 unsigned length() const;
207 205
208 bool isClosed() const { return m_closed; } 206 bool isClosed() const { return m_closed; }
209 207
210 enum LookAheadResult { 208 enum LookAheadResult {
211 DidNotMatch, 209 DidNotMatch,
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 bool m_closed; 417 bool m_closed;
420 bool m_empty; 418 bool m_empty;
421 unsigned char m_fastPathFlags; 419 unsigned char m_fastPathFlags;
422 void (SegmentedString::*m_advanceFunc)(); 420 void (SegmentedString::*m_advanceFunc)();
423 void (SegmentedString::*m_advanceAndUpdateLineNumberFunc)(); 421 void (SegmentedString::*m_advanceAndUpdateLineNumberFunc)();
424 }; 422 };
425 423
426 } 424 }
427 425
428 #endif 426 #endif
OLDNEW
« no previous file with comments | « Source/core/html/parser/HTMLEntityParserTest.cpp ('k') | Source/platform/text/SegmentedStringTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698