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

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

Issue 1308573006: [reland] SegmentedString::push() should always push a char in front (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: fix test / accept yosin@ suggestion 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
193 if (!m_pushedChar1) { 195 if (!m_pushedChar1) {
194 m_pushedChar1 = c; 196 m_currentChar = m_pushedChar1 = c;
195 m_currentChar = m_pushedChar1 ? m_pushedChar1 : m_currentString.getC urrentChar();
196 updateSlowCaseFunctionPointers(); 197 updateSlowCaseFunctionPointers();
197 } else { 198 } else {
198 ASSERT(!m_pushedChar2); 199 ASSERT(!m_pushedChar2);
199 m_pushedChar2 = c; 200 m_pushedChar2 = m_pushedChar1;
201 m_currentChar = m_pushedChar1 = c;
200 } 202 }
201 } 203 }
202 204
203 bool isEmpty() const { return m_empty; } 205 bool isEmpty() const { return m_empty; }
204 unsigned length() const; 206 unsigned length() const;
205 207
206 bool isClosed() const { return m_closed; } 208 bool isClosed() const { return m_closed; }
207 209
208 enum LookAheadResult { 210 enum LookAheadResult {
209 DidNotMatch, 211 DidNotMatch,
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 bool m_closed; 410 bool m_closed;
409 bool m_empty; 411 bool m_empty;
410 unsigned char m_fastPathFlags; 412 unsigned char m_fastPathFlags;
411 void (SegmentedString::*m_advanceFunc)(); 413 void (SegmentedString::*m_advanceFunc)();
412 void (SegmentedString::*m_advanceAndUpdateLineNumberFunc)(); 414 void (SegmentedString::*m_advanceAndUpdateLineNumberFunc)();
413 }; 415 };
414 416
415 } 417 }
416 418
417 #endif 419 #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