[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc
jianli at chromium.org
jianli at chromium.org
Wed Dec 22 12:24:52 UTC 2010
The following commit has been merged in the debian/experimental branch:
commit 755acaa86935eb5cc7d9200358749efa2a6abb75
Author: jianli at chromium.org <jianli at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sun Aug 22 21:32:33 2010 +0000
Add the blob URL member to FormData.
https://bugs.webkit.org/show_bug.cgi?id=44387
Reviewed by Darin Fisher.
WebCore:
This is in preparation to switch blob implementation to using BlobData
model. When a blob is added to a FormData, it is represented as a blob
URL in the list.
* platform/network/FormData.cpp:
(WebCore::FormData::appendBlob):
* platform/network/FormData.h:
(WebCore::FormDataElement::FormDataElement):
(WebCore::FormDataElement::):
(WebCore::operator==):
WebKit/chromium:
As the result of adding the blob URL member to the FormData, we need
to update the corresponding WebKit API for chromium.
* public/WebHTTPBody.h:
(WebKit::WebHTTPBody::Element::):
* src/WebHTTPBody.cpp:
(WebKit::WebHTTPBody::elementAt):
(WebKit::WebHTTPBody::appendBlob):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65786 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 8087148..dc7b4ac 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,21 @@
+2010-08-22 Jian Li <jianli at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add the blob URL member to FormData.
+ https://bugs.webkit.org/show_bug.cgi?id=44387
+
+ This is in preparation to switch blob implementation to using BlobData
+ model. When a blob is added to a FormData, it is represented as a blob
+ URL in the list.
+
+ * platform/network/FormData.cpp:
+ (WebCore::FormData::appendBlob):
+ * platform/network/FormData.h:
+ (WebCore::FormDataElement::FormDataElement):
+ (WebCore::FormDataElement::):
+ (WebCore::operator==):
+
2010-08-22 Eric Seidel <eric at webkit.org>
Reviewed by Adam Barth.
diff --git a/WebCore/platform/network/FormData.cpp b/WebCore/platform/network/FormData.cpp
index 31506ea..4f2b365 100644
--- a/WebCore/platform/network/FormData.cpp
+++ b/WebCore/platform/network/FormData.cpp
@@ -139,6 +139,11 @@ PassRefPtr<FormData> FormData::deepCopy() const
formData->m_elements.append(FormDataElement(e.m_filename, e.m_shouldGenerateFile));
#endif
break;
+#if ENABLE(BLOB)
+ case FormDataElement::encodedBlob:
+ formData->m_elements.append(FormDataElement(e.m_blobURL));
+ break;
+#endif
}
}
return formData.release();
@@ -200,6 +205,11 @@ void FormData::appendFileRange(const String& filename, long long start, long lon
{
m_elements.append(FormDataElement(filename, start, length, expectedModificationTime, shouldGenerateFile));
}
+
+void FormData::appendBlob(const KURL& blobURL)
+{
+ m_elements.append(FormDataElement(blobURL));
+}
#endif
void FormData::appendKeyValuePairItems(const BlobItemList& items, const TextEncoding& encoding, bool isMultiPartForm, Document* document)
diff --git a/WebCore/platform/network/FormData.h b/WebCore/platform/network/FormData.h
index a1964e3..d7faa89 100644
--- a/WebCore/platform/network/FormData.h
+++ b/WebCore/platform/network/FormData.h
@@ -20,6 +20,7 @@
#ifndef FormData_h
#define FormData_h
+#include "KURL.h"
#include "PlatformString.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
@@ -39,17 +40,25 @@ public:
#if ENABLE(BLOB)
FormDataElement(const String& filename, long long fileStart, long long fileLength, double expectedFileModificationTime, bool shouldGenerateFile) : m_type(encodedFile), m_filename(filename), m_fileStart(fileStart), m_fileLength(fileLength), m_expectedFileModificationTime(expectedFileModificationTime), m_shouldGenerateFile(shouldGenerateFile) { }
+ FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_blobURL(blobURL) { }
#else
FormDataElement(const String& filename, bool shouldGenerateFile) : m_type(encodedFile), m_filename(filename), m_shouldGenerateFile(shouldGenerateFile) { }
#endif
- enum { data, encodedFile } m_type;
+ enum {
+ data,
+ encodedFile
+#if ENABLE(BLOB)
+ , encodedBlob
+#endif
+ } m_type;
Vector<char> m_data;
String m_filename;
#if ENABLE(BLOB)
long long m_fileStart;
long long m_fileLength;
double m_expectedFileModificationTime;
+ KURL m_blobURL;
#endif
String m_generatedFilename;
bool m_shouldGenerateFile;
@@ -67,14 +76,16 @@ inline bool operator==(const FormDataElement& a, const FormDataElement& b)
if (a.m_type != b.m_type)
return false;
- if (a.m_data != b.m_data)
- return false;
+ if (a.m_type == FormDataElement::data)
+ return a.m_data == b.m_data;
+ if (a.m_type == FormDataElement::encodedFile)
#if ENABLE(BLOB)
- if (a.m_filename != b.m_filename || a.m_fileStart != b.m_fileStart || a.m_fileLength != b.m_fileLength || a.m_expectedFileModificationTime != b.m_expectedFileModificationTime)
+ return a.m_filename == b.m_filename && a.m_fileStart == b.m_fileStart && a.m_fileLength == b.m_fileLength && a.m_expectedFileModificationTime == b.m_expectedFileModificationTime;
+ if (a.m_type == FormDataElement::encodedBlob)
+ return a.m_blobURL == b.m_blobURL;
#else
- if (a.m_filename != b.m_filename)
+ return a.m_filename == b.m_filename;
#endif
- return false;
return true;
}
@@ -101,6 +112,7 @@ public:
void appendFile(const String& filename, bool shouldGenerateFile = false);
#if ENABLE(BLOB)
void appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime, bool shouldGenerateFile = false);
+ void appendBlob(const KURL& blobURL);
#endif
void flatten(Vector<char>&) const; // omits files
diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index e13823c..8f37579 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,19 @@
+2010-08-22 Jian Li <jianli at chromium.org>
+
+ Reviewed by Darin Fisher.
+
+ Add the blob URL member to FormData.
+ https://bugs.webkit.org/show_bug.cgi?id=44387
+
+ As the result of adding the blob URL member to the FormData, we need
+ to update the corresponding WebKit API for chromium.
+
+ * public/WebHTTPBody.h:
+ (WebKit::WebHTTPBody::Element::):
+ * src/WebHTTPBody.cpp:
+ (WebKit::WebHTTPBody::elementAt):
+ (WebKit::WebHTTPBody::appendBlob):
+
2010-08-20 Kinuko Yasuda <kinuko at chromium.org>
Unreviewed; build fix for chromium (and remove duplicated ChangeLog entry).
diff --git a/WebKit/chromium/public/WebHTTPBody.h b/WebKit/chromium/public/WebHTTPBody.h
index a7dc7c9..a2bb5cd 100644
--- a/WebKit/chromium/public/WebHTTPBody.h
+++ b/WebKit/chromium/public/WebHTTPBody.h
@@ -35,6 +35,7 @@
#include "WebFileInfo.h"
#include "WebNonCopyable.h"
#include "WebString.h"
+#include "WebURL.h"
#if WEBKIT_IMPLEMENTATION
namespace WebCore { class FormData; }
@@ -48,12 +49,13 @@ class WebHTTPBodyPrivate;
class WebHTTPBody {
public:
struct Element {
- enum { TypeData, TypeFile } type;
+ enum { TypeData, TypeFile, TypeBlob } type;
WebData data;
WebString filePath;
long long fileStart;
long long fileLength; // -1 means to the end of the file.
WebFileInfo fileInfo;
+ WebURL blobURL;
};
~WebHTTPBody() { reset(); }
@@ -84,6 +86,7 @@ public:
WEBKIT_API void appendFile(const WebString&);
// Passing -1 to fileLength means to the end of the file.
WEBKIT_API void appendFileRange(const WebString&, long long fileStart, long long fileLength, const WebFileInfo&);
+ WEBKIT_API void appendBlob(const WebURL&);
// Identifies a particular form submission instance. A value of 0 is
// used to indicate an unspecified identifier.
diff --git a/WebKit/chromium/src/WebHTTPBody.cpp b/WebKit/chromium/src/WebHTTPBody.cpp
index fa75387..e54b4e5 100644
--- a/WebKit/chromium/src/WebHTTPBody.cpp
+++ b/WebKit/chromium/src/WebHTTPBody.cpp
@@ -74,31 +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();
-#if ENABLE(BLOB)
- result.fileStart = 0;
- result.fileLength = 0;
- result.fileInfo.modificationTime = 0.0;
-#endif
break;
case FormDataElement::encodedFile:
result.type = Element::TypeFile;
- result.data.reset();
result.filePath = element.m_filename;
#if ENABLE(BLOB)
result.fileStart = element.m_fileStart;
result.fileLength = element.m_fileLength;
result.fileInfo.modificationTime = element.m_expectedFileModificationTime;
-#else
- result.fileStart = 0;
- result.fileLength = -1;
- result.fileInfo.modificationTime = 0.0;
#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;
@@ -129,6 +131,14 @@ void WebHTTPBody::appendFileRange(const WebString& filePath, long long fileStart
#endif
}
+void WebHTTPBody::appendBlob(const WebURL& blobURL)
+{
+#if ENABLE(BLOB)
+ ensureMutable();
+ m_private->appendBlob(blobURL);
+#endif
+}
+
long long WebHTTPBody::identifier() const
{
ASSERT(!isNull());
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list