<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[55821] trunk/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/55821">55821</a></dd>
<dt>Author</dt> <dd>jianli@chromium.org</dd>
<dt>Date</dt> <dd>2010-03-10 17:19:41 -0800 (Wed, 10 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implementing DOMFormData class.
https://bugs.webkit.org/show_bug.cgi?id=35707

Reviewed by Dmitry Titov.

This patch only addresses the implementation of DOMFormData class and
moves the FormData construction logic from HTMLFormElement::createFormData
to FormData::create() so that it can be used by both HTMLFormElement
and XMLHttpRequest.

The DOMFormData IDL interface will be exposed in another patch and the
test will be added then.

* Android.mk:
* GNUmakefile.am:
* WebCore.gypi:
* WebCore.pro:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* html/DOMFormData.cpp: Added.
* html/DOMFormData.h: Added.
* html/FormDataList.h:
(WebCore::FormDataList::encoding):
* html/HTMLFormElement.cpp:
(WebCore::HTMLFormElement::createFormData):
(WebCore::HTMLFormElement::submit):
* html/HTMLFormElement.h:
* platform/network/FormData.cpp:
(WebCore::FormData::create):
(WebCore::FormData::createMultiPart):
(WebCore::FormData::appendDOMFormData):
* platform/network/FormData.h:
(WebCore::FormData::boundary):
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::send):
* xml/XMLHttpRequest.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreAndroidmk">trunk/WebCore/Android.mk</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreGNUmakefileam">trunk/WebCore/GNUmakefile.am</a></li>
<li><a href="#trunkWebCoreWebCoregypi">trunk/WebCore/WebCore.gypi</a></li>
<li><a href="#trunkWebCoreWebCorepro">trunk/WebCore/WebCore.pro</a></li>
<li><a href="#trunkWebCoreWebCorevcprojWebCorevcproj">trunk/WebCore/WebCore.vcproj/WebCore.vcproj</a></li>
<li><a href="#trunkWebCoreWebCorexcodeprojprojectpbxproj">trunk/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkWebCorehtmlFormDataListh">trunk/WebCore/html/FormDataList.h</a></li>
<li><a href="#trunkWebCorehtmlHTMLFormElementcpp">trunk/WebCore/html/HTMLFormElement.cpp</a></li>
<li><a href="#trunkWebCorehtmlHTMLFormElementh">trunk/WebCore/html/HTMLFormElement.h</a></li>
<li><a href="#trunkWebCoreplatformnetworkFormDatacpp">trunk/WebCore/platform/network/FormData.cpp</a></li>
<li><a href="#trunkWebCoreplatformnetworkFormDatah">trunk/WebCore/platform/network/FormData.h</a></li>
<li><a href="#trunkWebCorexmlXMLHttpRequestcpp">trunk/WebCore/xml/XMLHttpRequest.cpp</a></li>
<li><a href="#trunkWebCorexmlXMLHttpRequesth">trunk/WebCore/xml/XMLHttpRequest.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebCorehtmlDOMFormDatacpp">trunk/WebCore/html/DOMFormData.cpp</a></li>
<li><a href="#trunkWebCorehtmlDOMFormDatah">trunk/WebCore/html/DOMFormData.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreAndroidmk"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/Android.mk (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/Android.mk        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/Android.mk        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -239,6 +239,7 @@
</span><span class="cx">         \
</span><span class="cx">         html/Blob.cpp \
</span><span class="cx">         html/CollectionCache.cpp \
</span><ins>+        html/DOMFormData.cpp \
</ins><span class="cx">         html/File.cpp \
</span><span class="cx">         html/FileList.cpp \
</span><span class="cx">         html/FormDataList.cpp \
</span></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/ChangeLog        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2010-03-10  Jian Li  &lt;jianli@chromium.org&gt;
+
+        Reviewed by Dmitry Titov.
+
+        Implementing DOMFormData class.
+        https://bugs.webkit.org/show_bug.cgi?id=35707
+
+        This patch only addresses the implementation of DOMFormData class and
+        moves the FormData construction logic from HTMLFormElement::createFormData
+        to FormData::create() so that it can be used by both HTMLFormElement
+        and XMLHttpRequest.
+
+        The DOMFormData IDL interface will be exposed in another patch and the
+        test will be added then.
+
+        * Android.mk:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * html/DOMFormData.cpp: Added.
+        * html/DOMFormData.h: Added.
+        * html/FormDataList.h:
+        (WebCore::FormDataList::encoding):
+        * html/HTMLFormElement.cpp:
+        (WebCore::HTMLFormElement::createFormData):
+        (WebCore::HTMLFormElement::submit):
+        * html/HTMLFormElement.h:
+        * platform/network/FormData.cpp:
+        (WebCore::FormData::create):
+        (WebCore::FormData::createMultiPart):
+        (WebCore::FormData::appendDOMFormData):
+        * platform/network/FormData.h:
+        (WebCore::FormData::boundary):
+        * xml/XMLHttpRequest.cpp:
+        (WebCore::XMLHttpRequest::send):
+        * xml/XMLHttpRequest.h:
+
</ins><span class="cx"> 2010-03-10  Chris Fleizach  &lt;cfleizach@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Beth Dakin.
</span></span></pre></div>
<a id="trunkWebCoreGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/GNUmakefile.am (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/GNUmakefile.am        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/GNUmakefile.am        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -1008,6 +1008,8 @@
</span><span class="cx">         WebCore/html/DateComponents.h \
</span><span class="cx">         WebCore/html/DOMDataGridDataSource.cpp \
</span><span class="cx">         WebCore/html/DOMDataGridDataSource.h \
</span><ins>+        WebCore/html/DOMFormData.cpp \
+        WebCore/html/DOMFormData.h \
</ins><span class="cx">         WebCore/html/File.cpp \
</span><span class="cx">         WebCore/html/File.h \
</span><span class="cx">         WebCore/html/FileList.cpp \
</span></span></pre></div>
<a id="trunkWebCoreWebCoregypi"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.gypi (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.gypi        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/WebCore.gypi        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -1412,6 +1412,8 @@
</span><span class="cx">             'html/DataGridColumn.h',
</span><span class="cx">             'html/DOMDataGridDataSource.cpp',
</span><span class="cx">             'html/DOMDataGridDataSource.h',
</span><ins>+            'html/DOMFormData.cpp',
+            'html/DOMFormData.h',
</ins><span class="cx">             'html/DataGridColumnList.cpp',
</span><span class="cx">             'html/DataGridColumnList.h',
</span><span class="cx">             'html/DateComponents.cpp',
</span></span></pre></div>
<a id="trunkWebCoreWebCorepro"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.pro (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.pro        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/WebCore.pro        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -598,6 +598,7 @@
</span><span class="cx">     html/DataGridColumnList.cpp \
</span><span class="cx">     html/DateComponents.cpp \
</span><span class="cx">     html/DOMDataGridDataSource.cpp \
</span><ins>+    html/DOMFormData.cpp \
</ins><span class="cx">     html/File.cpp \
</span><span class="cx">     html/FileList.cpp \
</span><span class="cx">     html/FormDataList.cpp \
</span><span class="lines">@@ -1295,6 +1296,7 @@
</span><span class="cx">     html/DataGridColumnList.h \
</span><span class="cx">     html/DateComponents.h \
</span><span class="cx">     html/DOMDataGridDataSource.h \
</span><ins>+    html/DOMFormData.h \
</ins><span class="cx">     html/File.h \
</span><span class="cx">     html/FileList.h \
</span><span class="cx">     html/FormDataList.h \
</span></span></pre></div>
<a id="trunkWebCoreWebCorevcprojWebCorevcproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.vcproj/WebCore.vcproj (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -29973,6 +29973,14 @@
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span><span class="cx">                         &lt;File
</span><ins>+                                RelativePath=&quot;..\html\DOMFormData.cpp&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
+                                RelativePath=&quot;..\html\DOMFormData.h&quot;
+                                &gt;
+                        &lt;/File&gt;
+                        &lt;File
</ins><span class="cx">                                 RelativePath=&quot;..\html\File.cpp&quot;
</span><span class="cx">                                 &gt;
</span><span class="cx">                         &lt;/File&gt;
</span></span></pre></div>
<a id="trunkWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.xcodeproj/project.pbxproj (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -625,6 +625,8 @@
</span><span class="cx">                 2ECF7ADD10162B3800427DE7 /* JSErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ECF7ADB10162B3800427DE7 /* JSErrorEvent.h */; };
</span><span class="cx">                 2ECF7AE110162B5800427DE7 /* ErrorEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ECF7ADE10162B5800427DE7 /* ErrorEvent.cpp */; };
</span><span class="cx">                 2ECF7AE210162B5800427DE7 /* ErrorEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ECF7ADF10162B5800427DE7 /* ErrorEvent.h */; };
</span><ins>+                2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 2ED609BA1145B07100C8684E /* DOMFormData.cpp */; };
+                2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */ = {isa = PBXBuildFile; fileRef = 2ED609BB1145B07100C8684E /* DOMFormData.h */; };
</ins><span class="cx">                 31288E720E3005D6003619AE /* WebKitCSSKeyframeRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31288E6E0E3005D6003619AE /* WebKitCSSKeyframeRule.cpp */; };
</span><span class="cx">                 31288E730E3005D6003619AE /* WebKitCSSKeyframeRule.h in Headers */ = {isa = PBXBuildFile; fileRef = 31288E6F0E3005D6003619AE /* WebKitCSSKeyframeRule.h */; };
</span><span class="cx">                 31288E740E3005D6003619AE /* WebKitCSSKeyframesRule.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 31288E700E3005D6003619AE /* WebKitCSSKeyframesRule.cpp */; };
</span><span class="lines">@@ -5990,6 +5992,8 @@
</span><span class="cx">                 2ECF7ADE10162B5800427DE7 /* ErrorEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ErrorEvent.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2ECF7ADF10162B5800427DE7 /* ErrorEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ErrorEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 2ECF7AE010162B5800427DE7 /* ErrorEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ErrorEvent.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                2ED609BA1145B07100C8684E /* DOMFormData.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMFormData.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                2ED609BB1145B07100C8684E /* DOMFormData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMFormData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 31288E6E0E3005D6003619AE /* WebKitCSSKeyframeRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSKeyframeRule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31288E6F0E3005D6003619AE /* WebKitCSSKeyframeRule.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebKitCSSKeyframeRule.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 31288E700E3005D6003619AE /* WebKitCSSKeyframesRule.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebKitCSSKeyframesRule.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -12874,6 +12878,8 @@
</span><span class="cx">                                 F5D3A57B106B83B300545297 /* DateComponents.h */,
</span><span class="cx">                                 BC7DAAEC0FF9615D00CE0138 /* DOMDataGridDataSource.cpp */,
</span><span class="cx">                                 BC7DAAED0FF9615D00CE0138 /* DOMDataGridDataSource.h */,
</span><ins>+                                2ED609BA1145B07100C8684E /* DOMFormData.cpp */,
+                                2ED609BB1145B07100C8684E /* DOMFormData.h */,
</ins><span class="cx">                                 BCDBB8CC0E08958400C60FF6 /* File.cpp */,
</span><span class="cx">                                 BCDBB8CB0E08958400C60FF6 /* File.h */,
</span><span class="cx">                                 BC1881D90E08C4ED00048C13 /* File.idl */,
</span><span class="lines">@@ -18668,6 +18674,7 @@
</span><span class="cx">                                 BC53DA2E1143121E000D817E /* DOMWrapperWorld.h in Headers */,
</span><span class="cx">                                 BC53DA601143141A000D817E /* DOMObjectHashTableMap.h in Headers */,
</span><span class="cx">                                 BC53DAC211432EEE000D817E /* JSDebugWrapperSet.h in Headers */,
</span><ins>+                                2ED609BD1145B07100C8684E /* DOMFormData.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -20867,6 +20874,7 @@
</span><span class="cx">                                 BC53DA62114314BD000D817E /* DOMObjectHashTableMap.cpp in Sources */,
</span><span class="cx">                                 BC53DAC511432FD9000D817E /* JSDebugWrapperSet.cpp in Sources */,
</span><span class="cx">                                 BC53DAC711433064000D817E /* JSDOMWrapper.cpp in Sources */,
</span><ins>+                                2ED609BC1145B07100C8684E /* DOMFormData.cpp in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkWebCorehtmlDOMFormDatacpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/html/DOMFormData.cpp (0 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/DOMFormData.cpp                                (rev 0)
+++ trunk/WebCore/html/DOMFormData.cpp        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;DOMFormData.h&quot;
+
+#include &quot;Blob.h&quot;
+#include &quot;PlatformString.h&quot;
+#include &quot;TextEncoding.h&quot;
+
+namespace WebCore {
+
+DOMFormData::DOMFormData(const TextEncoding&amp; encoding)
+    : FormDataList(encoding)
+{
+}
+
+void DOMFormData::append(const String&amp; name, const String&amp; value)
+{
+    if (!name.isEmpty())
+        appendData(name, value);
+}
+
+void DOMFormData::append(const String&amp; name, Blob* blob)
+{
+    // FIXME: Need to support sliced file when Blob.slice support is landed.
+    if (!name.isEmpty() &amp;&amp; !blob-&gt;path().isEmpty()) {
+        RefPtr&lt;File&gt; file = static_cast&lt;File*&gt;(blob);
+        appendFile(name, file.release());
+    }
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkWebCorehtmlDOMFormDatah"></a>
<div class="addfile"><h4>Added: trunk/WebCore/html/DOMFormData.h (0 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/DOMFormData.h                                (rev 0)
+++ trunk/WebCore/html/DOMFormData.h        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef DOMFormData_h
+#define DOMFormData_h
+
+#include &quot;FormDataList.h&quot;
+#include &lt;wtf/PassRefPtr.h&gt;
+#include &lt;wtf/RefCounted.h&gt;
+
+namespace WebCore {
+
+class Blob;
+class String;
+class TextEncoding;
+
+class DOMFormData : public FormDataList, public RefCounted&lt;DOMFormData&gt; {
+public:
+    static PassRefPtr&lt;DOMFormData&gt; create() { return adoptRef(new DOMFormData(UTF8Encoding())); }
+    static PassRefPtr&lt;DOMFormData&gt; create(const TextEncoding&amp; encoding) { return adoptRef(new DOMFormData(encoding)); }
+
+    void append(const String&amp; name, const String&amp; value);
+    void append(const String&amp; name, Blob*);
+
+private:
+    DOMFormData(const TextEncoding&amp;);
+};
+
+} // namespace WebCore
+
+#endif // DOMFormData_h
</ins></span></pre></div>
<a id="trunkWebCorehtmlFormDataListh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/FormDataList.h (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/FormDataList.h        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/html/FormDataList.h        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -55,6 +55,7 @@
</span><span class="cx">     };
</span><span class="cx"> 
</span><span class="cx">     const Vector&lt;Item&gt;&amp; list() const { return m_list; }
</span><ins>+    const TextEncoding&amp; encoding() const { return m_encoding; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     void appendString(const CString&amp;);
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLFormElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLFormElement.cpp (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLFormElement.cpp        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/html/HTMLFormElement.cpp        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -26,8 +26,7 @@
</span><span class="cx"> #include &quot;HTMLFormElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSHelper.h&quot;
</span><del>-#include &quot;Chrome.h&quot;
-#include &quot;ChromeClient.h&quot;
</del><ins>+#include &quot;DOMFormData.h&quot;
</ins><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="lines">@@ -46,7 +45,6 @@
</span><span class="cx"> #include &quot;ScriptEventListener.h&quot;
</span><span class="cx"> #include &quot;MIMETypeRegistry.h&quot;
</span><span class="cx"> #include &quot;MappedAttribute.h&quot;
</span><del>-#include &quot;Page.h&quot;
</del><span class="cx"> #include &quot;RenderTextControl.h&quot;
</span><span class="cx"> #include &quot;ValidityState.h&quot;
</span><span class="cx"> #include &lt;limits&gt;
</span><span class="lines">@@ -201,84 +199,17 @@
</span><span class="cx">     return m_formDataBuilder.dataEncoding(document());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-PassRefPtr&lt;FormData&gt; HTMLFormElement::createFormData(const CString&amp; boundary)
</del><ins>+PassRefPtr&lt;FormData&gt; HTMLFormElement::createFormData()
</ins><span class="cx"> {
</span><del>-    Vector&lt;char&gt; encodedData;
-    TextEncoding encoding = dataEncoding().encodingForFormSubmission();
-
-    RefPtr&lt;FormData&gt; result = FormData::create();
-
</del><ins>+    RefPtr&lt;DOMFormData&gt; domFormData = DOMFormData::create(dataEncoding().encodingForFormSubmission());
</ins><span class="cx">     for (unsigned i = 0; i &lt; formElements.size(); ++i) {
</span><span class="cx">         HTMLFormControlElement* control = formElements[i];
</span><del>-        FormDataList list(encoding);
-
-        if (!control-&gt;disabled() &amp;&amp; control-&gt;appendFormData(list, m_formDataBuilder.isMultiPartForm())) {
-            size_t formDataListSize = list.list().size();
-            ASSERT(formDataListSize % 2 == 0);
-            for (size_t j = 0; j &lt; formDataListSize; j += 2) {
-                const FormDataList::Item&amp; key = list.list()[j];
-                const FormDataList::Item&amp; value = list.list()[j + 1];
-                if (!m_formDataBuilder.isMultiPartForm()) {
-                    // Omit the name &quot;isindex&quot; if it's the first form data element.
-                    // FIXME: Why is this a good rule? Is this obsolete now?
-                    if (encodedData.isEmpty() &amp;&amp; key.data() == &quot;isindex&quot;)
-                        FormDataBuilder::encodeStringAsFormData(encodedData, value.data());
-                    else
-                        m_formDataBuilder.addKeyValuePairAsFormData(encodedData, key.data(), value.data());
-                } else {
-                    Vector&lt;char&gt; header;
-                    m_formDataBuilder.beginMultiPartHeader(header, boundary, key.data());
-
-                    bool shouldGenerateFile = false;
-                    // if the current type is FILE, then we also need to include the filename
-                    if (value.file()) {
-                        const String&amp; path = value.file()-&gt;path();
-                        String fileName = value.file()-&gt;fileName();
-
-                        // Let the application specify a filename if it's going to generate a replacement file for the upload.
-                        if (!path.isEmpty()) {
-                            if (Page* page = document()-&gt;page()) {
-                                String generatedFileName;
-                                shouldGenerateFile = page-&gt;chrome()-&gt;client()-&gt;shouldReplaceWithGeneratedFileForUpload(path, generatedFileName);
-                                if (shouldGenerateFile)
-                                    fileName = generatedFileName;
-                            }
-                        }
-
-                        // We have to include the filename=&quot;..&quot; part in the header, even if the filename is empty
-                        m_formDataBuilder.addFilenameToMultiPartHeader(header, encoding, fileName);
-
-                        if (!fileName.isEmpty()) {
-                            // FIXME: The MIMETypeRegistry function's name makes it sound like it takes a path,
-                            // not just a basename. But filename is not the path. But note that it's not safe to
-                            // just use path instead since in the generated-file case it will not reflect the
-                            // MIME type of the generated file.
-                            String mimeType = MIMETypeRegistry::getMIMETypeForPath(fileName);
-                            if (!mimeType.isEmpty())
-                                m_formDataBuilder.addContentTypeToMultiPartHeader(header, mimeType.latin1());
-                        }
-                    }
-
-                    m_formDataBuilder.finishMultiPartHeader(header);
-
-                    // Append body
-                    result-&gt;appendData(header.data(), header.size());
-                    if (size_t dataSize = value.data().length())
-                        result-&gt;appendData(value.data().data(), dataSize);
-                    else if (value.file() &amp;&amp; !value.file()-&gt;path().isEmpty())
-                        result-&gt;appendFile(value.file()-&gt;path(), shouldGenerateFile);
-
-                    result-&gt;appendData(&quot;\r\n&quot;, 2);
-                }
-            }
-        }
</del><ins>+        if (!control-&gt;disabled())
+            control-&gt;appendFormData(*domFormData, m_formDataBuilder.isMultiPartForm());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (m_formDataBuilder.isMultiPartForm())
-        m_formDataBuilder.addBoundaryToMultiPartHeader(encodedData, boundary, true);
</del><ins>+    RefPtr&lt;FormData&gt; result = (m_formDataBuilder.isMultiPartForm()) ? FormData::createMultiPart(*domFormData, document()) : FormData::create(*domFormData);
</ins><span class="cx"> 
</span><del>-    result-&gt;appendData(encodedData.data(), encodedData.size());
-
</del><span class="cx">     result-&gt;setIdentifier(generateFormDataIdentifier());
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -389,8 +320,8 @@
</span><span class="cx">             ASSERT(!m_formDataBuilder.isMultiPartForm());
</span><span class="cx">         }
</span><span class="cx"> 
</span><ins>+        RefPtr&lt;FormData&gt; data = createFormData();
</ins><span class="cx">         if (!m_formDataBuilder.isMultiPartForm()) {
</span><del>-            RefPtr&lt;FormData&gt; data = createFormData(CString());
</del><span class="cx"> 
</span><span class="cx">             if (isMailtoForm()) {
</span><span class="cx">                 // Convert the form data into a string that we put into the URL.
</span><span class="lines">@@ -400,13 +331,11 @@
</span><span class="cx">             }
</span><span class="cx"> 
</span><span class="cx">             frame-&gt;loader()-&gt;submitForm(&quot;POST&quot;, m_url, data.release(), m_target, m_formDataBuilder.encodingType(), String(), lockHistory, event, formState.release());
</span><del>-        } else {
-            Vector&lt;char&gt; boundary = m_formDataBuilder.generateUniqueBoundaryString();
-            frame-&gt;loader()-&gt;submitForm(&quot;POST&quot;, m_url, createFormData(boundary.data()), m_target, m_formDataBuilder.encodingType(), boundary.data(), lockHistory, event, formState.release());
-        }
</del><ins>+        } else
+            frame-&gt;loader()-&gt;submitForm(&quot;POST&quot;, m_url, data.get(), m_target, m_formDataBuilder.encodingType(), data-&gt;boundary().data(), lockHistory, event, formState.release());
</ins><span class="cx">     } else {
</span><span class="cx">         m_formDataBuilder.setIsMultiPartForm(false);
</span><del>-        frame-&gt;loader()-&gt;submitForm(&quot;GET&quot;, m_url, createFormData(CString()), m_target, String(), String(), lockHistory, event, formState.release());
</del><ins>+        frame-&gt;loader()-&gt;submitForm(&quot;GET&quot;, m_url, createFormData(), m_target, String(), String(), lockHistory, event, formState.release());
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (needButtonActivation &amp;&amp; firstSuccessfulSubmitButton)
</span></span></pre></div>
<a id="trunkWebCorehtmlHTMLFormElementh"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/html/HTMLFormElement.h (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/html/HTMLFormElement.h        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/html/HTMLFormElement.h        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isMailtoForm() const;
</span><span class="cx">     TextEncoding dataEncoding() const;
</span><del>-    PassRefPtr&lt;FormData&gt; createFormData(const CString&amp; boundary);
</del><ins>+    PassRefPtr&lt;FormData&gt; createFormData();
</ins><span class="cx">     unsigned formElementIndex(HTMLFormControlElement*);
</span><span class="cx"> 
</span><span class="cx">     friend class HTMLFormCollection;
</span></span></pre></div>
<a id="trunkWebCoreplatformnetworkFormDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/network/FormData.cpp (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/network/FormData.cpp        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/platform/network/FormData.cpp        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -23,8 +23,14 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Blob.h&quot;
</span><span class="cx"> #include &quot;CString.h&quot;
</span><ins>+#include &quot;Chrome.h&quot;
</ins><span class="cx"> #include &quot;ChromeClient.h&quot;
</span><ins>+#include &quot;DOMFormData.h&quot;
+#include &quot;Document.h&quot;
</ins><span class="cx"> #include &quot;FileSystem.h&quot;
</span><ins>+#include &quot;FormDataBuilder.h&quot;
+#include &quot;MIMETypeRegistry.h&quot;
+#include &quot;Page.h&quot;
</ins><span class="cx"> #include &quot;TextEncoding.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -89,6 +95,20 @@
</span><span class="cx">     return result.release();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+PassRefPtr&lt;FormData&gt; FormData::create(const DOMFormData&amp; domFormData)
+{
+    RefPtr&lt;FormData&gt; result = create();
+    result-&gt;appendDOMFormData(domFormData, false, 0);
+    return result.release();
+}
+
+PassRefPtr&lt;FormData&gt; FormData::createMultiPart(const DOMFormData&amp; domFormData, Document* document)
+{
+    RefPtr&lt;FormData&gt; result = create();
+    result-&gt;appendDOMFormData(domFormData, true, document);
+    return result.release();
+}
+
</ins><span class="cx"> PassRefPtr&lt;FormData&gt; FormData::copy() const
</span><span class="cx"> {
</span><span class="cx">     return adoptRef(new FormData(*this));
</span><span class="lines">@@ -146,6 +166,81 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+void FormData::appendDOMFormData(const DOMFormData&amp; domFormData, bool isMultiPartForm, Document* document)
+{
+    FormDataBuilder formDataBuilder;
+    if (isMultiPartForm)
+        m_boundary = formDataBuilder.generateUniqueBoundaryString();
+
+    Vector&lt;char&gt; encodedData;
+    TextEncoding encoding = domFormData.encoding();
+
+    const Vector&lt;FormDataList::Item&gt;&amp; list = domFormData.list();
+    size_t formDataListSize = list.size();
+    ASSERT(!(formDataListSize % 2));
+    for (size_t i = 0; i &lt; formDataListSize; i += 2) {
+        const FormDataList::Item&amp; key = list[i];
+        const FormDataList::Item&amp; value = list[i + 1];
+        if (isMultiPartForm) {
+            Vector&lt;char&gt; header;
+            formDataBuilder.beginMultiPartHeader(header, m_boundary.data(), key.data());
+
+            bool shouldGenerateFile = false;
+            // If the current type is FILE, then we also need to include the filename
+            if (value.file()) {
+                const String&amp; path = value.file()-&gt;path();
+                String fileName = value.file()-&gt;fileName();
+
+                // Let the application specify a filename if it's going to generate a replacement file for the upload.
+                if (!path.isEmpty()) {
+                    if (Page* page = document-&gt;page()) {
+                        String generatedFileName;
+                        shouldGenerateFile = page-&gt;chrome()-&gt;client()-&gt;shouldReplaceWithGeneratedFileForUpload(path, generatedFileName);
+                        if (shouldGenerateFile)
+                            fileName = generatedFileName;
+                    }
+                }
+
+                // We have to include the filename=&quot;..&quot; part in the header, even if the filename is empty
+                formDataBuilder.addFilenameToMultiPartHeader(header, encoding, fileName);
+
+                if (!fileName.isEmpty()) {
+                    // FIXME: The MIMETypeRegistry function's name makes it sound like it takes a path,
+                    // not just a basename. But filename is not the path. But note that it's not safe to
+                    // just use path instead since in the generated-file case it will not reflect the
+                    // MIME type of the generated file.
+                    String mimeType = MIMETypeRegistry::getMIMETypeForPath(fileName);
+                    if (!mimeType.isEmpty())
+                        formDataBuilder.addContentTypeToMultiPartHeader(header, mimeType.latin1());
+                }
+            }
+
+            formDataBuilder.finishMultiPartHeader(header);
+
+            // Append body
+            appendData(header.data(), header.size());
+            if (size_t dataSize = value.data().length())
+                appendData(value.data().data(), dataSize);
+            else if (value.file() &amp;&amp; !value.file()-&gt;path().isEmpty())
+                appendFile(value.file()-&gt;path(), shouldGenerateFile);
+
+            appendData(&quot;\r\n&quot;, 2);
+        } else {
+            // Omit the name &quot;isindex&quot; if it's the first form data element.
+            // FIXME: Why is this a good rule? Is this obsolete now?
+            if (encodedData.isEmpty() &amp;&amp; key.data() == &quot;isindex&quot;)
+                FormDataBuilder::encodeStringAsFormData(encodedData, value.data());
+            else
+                formDataBuilder.addKeyValuePairAsFormData(encodedData, key.data(), value.data());
+        }
+    } 
+
+    if (isMultiPartForm)
+        formDataBuilder.addBoundaryToMultiPartHeader(encodedData, m_boundary.data(), true);
+
+    appendData(encodedData.data(), encodedData.size());
+}
+
</ins><span class="cx"> void FormData::flatten(Vector&lt;char&gt;&amp; data) const
</span><span class="cx"> {
</span><span class="cx">     // Concatenate all the byte arrays, but omit any files.
</span></span></pre></div>
<a id="trunkWebCoreplatformnetworkFormDatah"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/platform/network/FormData.h (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/platform/network/FormData.h        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/platform/network/FormData.h        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -27,6 +27,8 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class ChromeClient;
</span><ins>+class DOMFormData;
+class Document;
</ins><span class="cx"> 
</span><span class="cx"> class FormDataElement {
</span><span class="cx"> public:
</span><span class="lines">@@ -80,6 +82,8 @@
</span><span class="cx">     static PassRefPtr&lt;FormData&gt; create(const void*, size_t);
</span><span class="cx">     static PassRefPtr&lt;FormData&gt; create(const CString&amp;);
</span><span class="cx">     static PassRefPtr&lt;FormData&gt; create(const Vector&lt;char&gt;&amp;);
</span><ins>+    static PassRefPtr&lt;FormData&gt; create(const DOMFormData&amp;);
+    static PassRefPtr&lt;FormData&gt; createMultiPart(const DOMFormData&amp;, Document*);
</ins><span class="cx">     PassRefPtr&lt;FormData&gt; copy() const;
</span><span class="cx">     PassRefPtr&lt;FormData&gt; deepCopy() const;
</span><span class="cx">     ~FormData();
</span><span class="lines">@@ -95,6 +99,7 @@
</span><span class="cx"> 
</span><span class="cx">     bool isEmpty() const { return m_elements.isEmpty(); }
</span><span class="cx">     const Vector&lt;FormDataElement&gt;&amp; elements() const { return m_elements; }
</span><ins>+    const Vector&lt;char&gt;&amp; boundary() const { return m_boundary; }
</ins><span class="cx"> 
</span><span class="cx">     void generateFiles(ChromeClient*);
</span><span class="cx">     void removeGeneratedFilesIfNeeded();
</span><span class="lines">@@ -111,10 +116,13 @@
</span><span class="cx">     FormData();
</span><span class="cx">     FormData(const FormData&amp;);
</span><span class="cx"> 
</span><ins>+    void appendDOMFormData(const DOMFormData&amp; domFormData, bool isMultiPartForm, Document* document);
+
</ins><span class="cx">     Vector&lt;FormDataElement&gt; m_elements;
</span><span class="cx">     int64_t m_identifier;
</span><span class="cx">     bool m_hasGeneratedFiles;
</span><span class="cx">     bool m_alwaysStream;
</span><ins>+    Vector&lt;char&gt; m_boundary;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline bool operator==(const FormData&amp; a, const FormData&amp; b)
</span></span></pre></div>
<a id="trunkWebCorexmlXMLHttpRequestcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/xml/XMLHttpRequest.cpp (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/xml/XMLHttpRequest.cpp        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/xml/XMLHttpRequest.cpp        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;Cache.h&quot;
</span><span class="cx"> #include &quot;CString.h&quot;
</span><span class="cx"> #include &quot;CrossOriginAccessControl.h&quot;
</span><ins>+#include &quot;DOMFormData.h&quot;
</ins><span class="cx"> #include &quot;DOMImplementation.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><span class="lines">@@ -459,6 +460,25 @@
</span><span class="cx">     createRequest(ec);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void XMLHttpRequest::send(DOMFormData* body, ExceptionCode&amp; ec)
+{
+    if (!initSend(ec))
+        return;
+
+    if (m_method != &quot;GET&quot; &amp;&amp; m_method != &quot;HEAD&quot; &amp;&amp; m_url.protocolInHTTPFamily()) {
+        m_requestEntityBody = FormData::createMultiPart(*body, document());
+
+        String contentType = getRequestHeader(&quot;Content-Type&quot;);
+        if (contentType.isEmpty()) {
+            contentType = &quot;multipart/form-data; boundary=&quot;;
+            contentType += m_requestEntityBody-&gt;boundary().data();
+            setRequestHeaderInternal(&quot;Content-Type&quot;, contentType);
+        }
+    }
+
+    createRequest(ec);
+}
+
</ins><span class="cx"> void XMLHttpRequest::createRequest(ExceptionCode&amp; ec)
</span><span class="cx"> {
</span><span class="cx">     // The presence of upload event listeners forces us to use preflighting because POSTing to an URL that does not
</span></span></pre></div>
<a id="trunkWebCorexmlXMLHttpRequesth"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/xml/XMLHttpRequest.h (55820 => 55821)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/xml/XMLHttpRequest.h        2010-03-11 00:59:11 UTC (rev 55820)
+++ trunk/WebCore/xml/XMLHttpRequest.h        2010-03-11 01:19:41 UTC (rev 55821)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx"> 
</span><span class="cx"> class Blob;
</span><span class="cx"> class Document;
</span><ins>+class DOMFormData;
</ins><span class="cx"> class ResourceRequest;
</span><span class="cx"> class TextResourceDecoder;
</span><span class="cx"> class ThreadableLoader;
</span><span class="lines">@@ -74,6 +75,7 @@
</span><span class="cx">     void send(Document*, ExceptionCode&amp;);
</span><span class="cx">     void send(const String&amp;, ExceptionCode&amp;);
</span><span class="cx">     void send(Blob*, ExceptionCode&amp;);
</span><ins>+    void send(DOMFormData*, ExceptionCode&amp;);
</ins><span class="cx">     void abort();
</span><span class="cx">     void setRequestHeader(const AtomicString&amp; name, const String&amp; value, ExceptionCode&amp;);
</span><span class="cx">     void overrideMimeType(const String&amp; override);
</span></span></pre>
</div>
</div>

</body>
</html>