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

Side by Side Diff: third_party/WebKit/Source/web/WebSearchableFormData.cpp

Issue 2612903007: Migrate WTF::Vector::append() to ::push_back() [part 15 of N] (Closed)
Patch Set: 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) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 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 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
190 190
191 HTMLFormControlElement& control = toHTMLFormControlElement(*item); 191 HTMLFormControlElement& control = toHTMLFormControlElement(*item);
192 if (control.isDisabledFormControl() || control.name().isNull()) 192 if (control.isDisabledFormControl() || control.name().isNull())
193 continue; 193 continue;
194 194
195 FormData* formData = FormData::create(encoding); 195 FormData* formData = FormData::create(encoding);
196 control.appendToFormData(*formData); 196 control.appendToFormData(*formData);
197 197
198 for (const auto& entry : formData->entries()) { 198 for (const auto& entry : formData->entries()) {
199 if (!encodedString->isEmpty()) 199 if (!encodedString->isEmpty())
200 encodedString->append('&'); 200 encodedString->push_back('&');
201 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->name(), 201 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->name(),
202 FormDataEncoder::NormalizeCRLF); 202 FormDataEncoder::NormalizeCRLF);
203 encodedString->append('='); 203 encodedString->push_back('=');
204 if (&control == textElement) { 204 if (&control == textElement) {
205 encodedString->append("{searchTerms}", 13); 205 encodedString->append("{searchTerms}", 13);
206 isElementFound = true; 206 isElementFound = true;
207 } else { 207 } else {
208 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->value(), 208 FormDataEncoder::encodeStringAsFormData(*encodedString, entry->value(),
209 FormDataEncoder::NormalizeCRLF); 209 FormDataEncoder::NormalizeCRLF);
210 } 210 }
211 } 211 }
212 } 212 }
213 return isElementFound; 213 return isElementFound;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 266
267 String action(formElement->action()); 267 String action(formElement->action());
268 KURL url(formElement->document().completeURL(action.isNull() ? "" : action)); 268 KURL url(formElement->document().completeURL(action.isNull() ? "" : action));
269 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString); 269 RefPtr<EncodedFormData> formData = EncodedFormData::create(encodedString);
270 url.setQuery(formData->flattenToString()); 270 url.setQuery(formData->flattenToString());
271 m_url = url; 271 m_url = url;
272 m_encoding = String(encoding.name()); 272 m_encoding = String(encoding.name());
273 } 273 }
274 274
275 } // namespace blink 275 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/web/WebLocalFrameImpl.cpp ('k') | third_party/WebKit/Source/web/WebTextCheckingCompletionImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698