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

Unified Diff: WebKit/chromium/src/WebSearchableFormData.cpp

Issue 1769002: BlobBuilder/FormData refactor attempt (Closed)
Patch Set: back to simple FormData Created 10 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebKit/chromium/src/WebSearchableFormData.cpp
diff --git a/WebKit/chromium/src/WebSearchableFormData.cpp b/WebKit/chromium/src/WebSearchableFormData.cpp
index 601a497382d08fbc8f0d8516f0f3aab955021f19..4ecc2e42d55e1080415a2b6f49c4ec16497a6504 100644
--- a/WebKit/chromium/src/WebSearchableFormData.cpp
+++ b/WebKit/chromium/src/WebSearchableFormData.cpp
@@ -187,8 +187,8 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt
if (!formElement->appendFormData(dataList, false))
continue;
- const Vector<FormDataList::Item>& itemList = dataList.list();
- if (isTextElement && !itemList.isEmpty()) {
+ const BlobItemList& items = dataList.items();
+ if (isTextElement && !items.isEmpty()) {
if (textElement) {
// The auto-complete bar only knows how to fill in one value.
// This form has multiple fields; don't treat it as searchable.
@@ -196,20 +196,23 @@ bool HasSuitableTextElement(const HTMLFormElement* form, Vector<char>* encodedSt
}
textElement = static_cast<HTMLInputElement*>(formElement);
}
- for (Vector<FormDataList::Item>::const_iterator j(itemList.begin()); j != itemList.end(); ++j) {
+ for (BlobItemList::const_iterator j(items.begin()); j != items.end(); ++j) {
+ const StringBlobItem* item = (*j)->toStringBlobItem();
+ if (!item)
+ continue;
// Handle ISINDEX / <input name=isindex> specially, but only if it's
// the first entry.
- if (!encodedString->isEmpty() || j->data() != "isindex") {
+ if (!encodedString->isEmpty() || item->cstr() != "isindex") {
if (!encodedString->isEmpty())
encodedString->append('&');
- FormDataBuilder::encodeStringAsFormData(*encodedString, j->data());
+ FormDataBuilder::encodeStringAsFormData(*encodedString, item->cstr());
encodedString->append('=');
}
++j;
if (formElement == textElement)
encodedString->append("{searchTerms}", 13);
else
- FormDataBuilder::encodeStringAsFormData(*encodedString, j->data());
+ FormDataBuilder::encodeStringAsFormData(*encodedString, item->cstr());
}
}
« no previous file with comments | « WebKit/chromium/ChangeLog ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698