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

Side by Side Diff: third_party/WebKit/Source/platform/SharedBufferChunkReader.cpp

Issue 2615813003: Migrate WTF::Vector::append() to ::push_back() [part 14 of N] (Closed)
Patch Set: rebase, small fix in FontSettings.h Created 3 years, 11 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) 2011 Google Inc. All rights reserved. 2 * Copyright (C) 2011 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 chunk.clear(); 76 chunk.clear();
77 while (true) { 77 while (true) {
78 while (m_segmentIndex < m_segmentLength) { 78 while (m_segmentIndex < m_segmentLength) {
79 char currentCharacter = m_segment[m_segmentIndex++]; 79 char currentCharacter = m_segment[m_segmentIndex++];
80 if (currentCharacter != m_separator[m_separatorIndex]) { 80 if (currentCharacter != m_separator[m_separatorIndex]) {
81 if (m_separatorIndex > 0) { 81 if (m_separatorIndex > 0) {
82 SECURITY_DCHECK(m_separatorIndex <= m_separator.size()); 82 SECURITY_DCHECK(m_separatorIndex <= m_separator.size());
83 chunk.append(m_separator.data(), m_separatorIndex); 83 chunk.append(m_separator.data(), m_separatorIndex);
84 m_separatorIndex = 0; 84 m_separatorIndex = 0;
85 } 85 }
86 chunk.append(currentCharacter); 86 chunk.push_back(currentCharacter);
87 continue; 87 continue;
88 } 88 }
89 m_separatorIndex++; 89 m_separatorIndex++;
90 if (m_separatorIndex == m_separator.size()) { 90 if (m_separatorIndex == m_separator.size()) {
91 if (includeSeparator) 91 if (includeSeparator)
92 chunk.appendVector(m_separator); 92 chunk.appendVector(m_separator);
93 m_separatorIndex = 0; 93 m_separatorIndex = 0;
94 return true; 94 return true;
95 } 95 }
96 } 96 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 break; 141 break;
142 } 142 }
143 data.append(segment, segmentLength); 143 data.append(segment, segmentLength);
144 readBytesCount += segmentLength; 144 readBytesCount += segmentLength;
145 bufferPosition += segmentLength; 145 bufferPosition += segmentLength;
146 } 146 }
147 return readBytesCount; 147 return readBytesCount;
148 } 148 }
149 149
150 } // namespace blink 150 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/platform/SharedBuffer.cpp ('k') | third_party/WebKit/Source/platform/TimerTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698