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

Side by Side Diff: third_party/WebKit/Source/core/editing/iterators/SearchBuffer.cpp

Issue 2766723002: Migrate WTF::Vector::prepend() to ::push_front() (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012 Apple Inc. All
3 * rights reserved. 3 * rights reserved.
4 * Copyright (C) 2005 Alexey Proskuryakov. 4 * Copyright (C) 2005 Alexey Proskuryakov.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 size_t wordBoundaryContextStart = length; 137 size_t wordBoundaryContextStart = length;
138 if (wordBoundaryContextStart) { 138 if (wordBoundaryContextStart) {
139 U16_BACK_1(characters, 0, wordBoundaryContextStart); 139 U16_BACK_1(characters, 0, wordBoundaryContextStart);
140 wordBoundaryContextStart = 140 wordBoundaryContextStart =
141 startOfLastWordBoundaryContext(characters, wordBoundaryContextStart); 141 startOfLastWordBoundaryContext(characters, wordBoundaryContextStart);
142 } 142 }
143 143
144 size_t usableLength = std::min(m_buffer.capacity() - m_prefixLength, 144 size_t usableLength = std::min(m_buffer.capacity() - m_prefixLength,
145 length - wordBoundaryContextStart); 145 length - wordBoundaryContextStart);
146 m_buffer.prepend(characters + length - usableLength, usableLength); 146 m_buffer.push_front(characters + length - usableLength, usableLength);
147 m_prefixLength += usableLength; 147 m_prefixLength += usableLength;
148 148
149 if (wordBoundaryContextStart || m_prefixLength == m_buffer.capacity()) 149 if (wordBoundaryContextStart || m_prefixLength == m_buffer.capacity())
150 m_needsMoreContext = false; 150 m_needsMoreContext = false;
151 } 151 }
152 152
153 inline bool SearchBuffer::atBreak() const { 153 inline bool SearchBuffer::atBreak() const {
154 return m_atBreak; 154 return m_atBreak;
155 } 155 }
156 156
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 423
424 EphemeralRangeInFlatTree findPlainText( 424 EphemeralRangeInFlatTree findPlainText(
425 const EphemeralRangeInFlatTree& inputRange, 425 const EphemeralRangeInFlatTree& inputRange,
426 const String& target, 426 const String& target,
427 FindOptions options) { 427 FindOptions options) {
428 return findPlainTextAlgorithm<EditingInFlatTreeStrategy>(inputRange, target, 428 return findPlainTextAlgorithm<EditingInFlatTreeStrategy>(inputRange, target,
429 options); 429 options);
430 } 430 }
431 431
432 } // namespace blink 432 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698