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

Unified Diff: Source/core/html/DOMFormData.cpp

Issue 1334513002: Fold FormDataList::getEntry(index) into DOMFormData. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 | « Source/core/html/DOMFormData.h ('k') | Source/core/html/FormDataList.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/DOMFormData.cpp
diff --git a/Source/core/html/DOMFormData.cpp b/Source/core/html/DOMFormData.cpp
index 7c25d6a06d35dca8f6687bbaf68e1a9861e235e1..8724bb963c6b768bc371f7c3a824da395788b30e 100644
--- a/Source/core/html/DOMFormData.cpp
+++ b/Source/core/html/DOMFormData.cpp
@@ -51,14 +51,14 @@ public:
if (m_current >= m_formData->size())
return false;
- const FormDataList::Entry entry = m_formData->getEntry(m_current++);
- key = entry.name();
- if (entry.isString())
- value.setUSVString(entry.string());
- else if (entry.isFile())
+ const FormDataList::Item& entry = m_formData->items()[m_current++];
+ key = m_formData->decode(entry.key());
+ if (entry.isString()) {
+ value.setUSVString(m_formData->decode(entry.data()));
+ } else {
+ ASSERT(entry.isFile());
value.setFile(entry.file());
- else
- ASSERT_NOT_REACHED();
+ }
return true;
}
@@ -212,6 +212,11 @@ void DOMFormData::setEntry(const Item& item)
return;
}
+String DOMFormData::decode(const CString& data) const
+{
+ return encoding().decode(data.data(), data.length());
+}
+
PairIterable<String, FormDataEntryValue>::IterationSource* DOMFormData::startIteration(ScriptState*, ExceptionState&)
{
if (m_opaque)
« no previous file with comments | « Source/core/html/DOMFormData.h ('k') | Source/core/html/FormDataList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698