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

Side by Side Diff: third_party/WebKit/Source/core/html/parser/AtomicHTMLToken.h

Issue 2583233002: Migrate WTF::Vector::append() to ::push_back() [part 7 of N] (Closed)
Patch Set: Created 4 years 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) 2013 Google, Inc. All Rights Reserved. 2 * Copyright (C) 2013 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 case HTMLToken::EndOfFile: 150 case HTMLToken::EndOfFile:
151 break; 151 break;
152 case HTMLToken::StartTag: 152 case HTMLToken::StartTag:
153 m_attributes.reserveInitialCapacity(token.attributes().size()); 153 m_attributes.reserveInitialCapacity(token.attributes().size());
154 for (const CompactHTMLToken::Attribute& attribute : 154 for (const CompactHTMLToken::Attribute& attribute :
155 token.attributes()) { 155 token.attributes()) {
156 QualifiedName name(nullAtom, AtomicString(attribute.name()), 156 QualifiedName name(nullAtom, AtomicString(attribute.name()),
157 nullAtom); 157 nullAtom);
158 // FIXME: This is N^2 for the number of attributes. 158 // FIXME: This is N^2 for the number of attributes.
159 if (!findAttributeInVector(m_attributes, name)) 159 if (!findAttributeInVector(m_attributes, name))
160 m_attributes.append( 160 m_attributes.push_back(
161 Attribute(name, AtomicString(attribute.value()))); 161 Attribute(name, AtomicString(attribute.value())));
162 } 162 }
163 // Fall through! 163 // Fall through!
164 case HTMLToken::EndTag: 164 case HTMLToken::EndTag:
165 m_selfClosing = token.selfClosing(); 165 m_selfClosing = token.selfClosing();
166 m_name = AtomicString(token.data()); 166 m_name = AtomicString(token.data());
167 break; 167 break;
168 case HTMLToken::Character: 168 case HTMLToken::Character:
169 case HTMLToken::Comment: 169 case HTMLToken::Comment:
170 m_data = token.data(); 170 m_data = token.data();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 if (attribute.nameAsVector().isEmpty()) 226 if (attribute.nameAsVector().isEmpty())
227 continue; 227 continue;
228 228
229 attribute.nameRange().checkValid(); 229 attribute.nameRange().checkValid();
230 attribute.valueRange().checkValid(); 230 attribute.valueRange().checkValid();
231 231
232 AtomicString value(attribute.value8BitIfNecessary()); 232 AtomicString value(attribute.value8BitIfNecessary());
233 const QualifiedName& name = nameForAttribute(attribute); 233 const QualifiedName& name = nameForAttribute(attribute);
234 // FIXME: This is N^2 for the number of attributes. 234 // FIXME: This is N^2 for the number of attributes.
235 if (!findAttributeInVector(m_attributes, name)) 235 if (!findAttributeInVector(m_attributes, name))
236 m_attributes.append(Attribute(name, value)); 236 m_attributes.push_back(Attribute(name, value));
237 } 237 }
238 } 238 }
239 239
240 } // namespace blink 240 } // namespace blink
241 241
242 #endif 242 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698