summaryrefslogtreecommitdiffstats
path: root/WebKit/chromium/src/WebHTTPBody.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/chromium/src/WebHTTPBody.cpp')
-rw-r--r--WebKit/chromium/src/WebHTTPBody.cpp41
1 files changed, 31 insertions, 10 deletions
diff --git a/WebKit/chromium/src/WebHTTPBody.cpp b/WebKit/chromium/src/WebHTTPBody.cpp
index 3d40869..e54b4e5 100644
--- a/WebKit/chromium/src/WebHTTPBody.cpp
+++ b/WebKit/chromium/src/WebHTTPBody.cpp
@@ -74,23 +74,33 @@ bool WebHTTPBody::elementAt(size_t index, Element& result) const
const FormDataElement& element = m_private->elements()[index];
+ result.data.reset();
+ result.filePath.reset();
+ result.fileStart = 0;
+ result.fileLength = 0;
+ result.fileInfo.modificationTime = 0.0;
+ result.blobURL = KURL();
+
switch (element.m_type) {
case FormDataElement::data:
result.type = Element::TypeData;
result.data.assign(element.m_data.data(), element.m_data.size());
- result.filePath.reset();
- result.fileStart = 0;
- result.fileLength = 0;
- result.fileInfo.modificationTime = 0.0;
break;
case FormDataElement::encodedFile:
result.type = Element::TypeFile;
- result.data.reset();
result.filePath = element.m_filename;
- result.fileStart = 0; // FIXME: to be set from FormData.
- result.fileLength = -1; // FIXME: to be set from FormData.
- result.fileInfo.modificationTime = 0.0; // FIXME: to be set from FormData.
+#if ENABLE(BLOB)
+ result.fileStart = element.m_fileStart;
+ result.fileLength = element.m_fileLength;
+ result.fileInfo.modificationTime = element.m_expectedFileModificationTime;
+#endif
+ break;
+#if ENABLE(BLOB)
+ case FormDataElement::encodedBlob:
+ result.type = Element::TypeBlob;
+ result.blobURL = element.m_blobURL;
break;
+#endif
default:
ASSERT_NOT_REACHED();
return false;
@@ -113,9 +123,20 @@ void WebHTTPBody::appendFile(const WebString& filePath)
m_private->appendFile(filePath);
}
-void WebHTTPBody::appendFile(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo)
+void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart, long long fileLength, const WebFileInfo& fileInfo)
{
- // FIXME: to be implemented.
+#if ENABLE(BLOB)
+ ensureMutable();
+ m_private->appendFileRange(filePath, fileStart, fileLength, fileInfo.modificationTime);
+#endif
+}
+
+void WebHTTPBody::appendBlob(const WebURL& blobURL)
+{
+#if ENABLE(BLOB)
+ ensureMutable();
+ m_private->appendBlob(blobURL);
+#endif
}
long long WebHTTPBody::identifier() const