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

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

Issue 564963002: New FormData methods: get, getAll, has, set, delete and iterable (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: webexposed/global-interface-listing updates Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/fileapi/File.cpp ('k') | Source/core/html/DOMFormData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/DOMFormData.h
diff --git a/Source/core/html/DOMFormData.h b/Source/core/html/DOMFormData.h
index afcfda2b8404204f356fc29b250586dbd712a53b..7ca05b29aa3b08ac25163ebb2e0197187c27d8d5 100644
--- a/Source/core/html/DOMFormData.h
+++ b/Source/core/html/DOMFormData.h
@@ -31,6 +31,9 @@
#ifndef DOMFormData_h
#define DOMFormData_h
+#include "bindings/core/v8/ScriptState.h"
+#include "bindings/core/v8/UnionTypesCore.h"
+#include "core/dom/Iterable.h"
#include "core/html/FormDataList.h"
#include "platform/heap/Handle.h"
#include "wtf/Forward.h"
@@ -46,8 +49,12 @@ namespace blink {
class Blob;
class HTMLFormElement;
-class DOMFormData final : public FormDataList, public ScriptWrappable {
+// Typedef from FormData.idl:
+typedef FileOrUSVString FormDataEntryValue;
+
+class DOMFormData final : public FormDataList, public ScriptWrappable, public PairIterable<String, FormDataEntryValue> {
DEFINE_WRAPPERTYPEINFO();
+
public:
static PassRefPtrWillBeRawPtr<DOMFormData> create(HTMLFormElement* form = 0)
{
@@ -59,12 +66,19 @@ public:
return adoptRefWillBeNoop(new DOMFormData(encoding));
}
+ // FormData interface.
void append(const String& name, const String& value);
void append(const String& name, Blob*, const String& filename = String());
+ void get(const String& name, FormDataEntryValue& result);
+ Vector<FormDataEntryValue> getAll(const String& name);
+ void set(const String& name, const String& value);
+ void set(const String& name, Blob*, const String& filename = String());
private:
explicit DOMFormData(const WTF::TextEncoding&);
explicit DOMFormData(HTMLFormElement*);
+
+ IterationSource* startIteration(ScriptState*, ExceptionState&) override;
};
} // namespace blink
« no previous file with comments | « Source/core/fileapi/File.cpp ('k') | Source/core/html/DOMFormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698