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

Unified Diff: Source/core/platform/network/FormData.h

Issue 23992003: blob hacking webcore style (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years, 2 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/platform/network/BlobData.cpp ('k') | Source/core/platform/network/FormData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/network/FormData.h
diff --git a/Source/core/platform/network/FormData.h b/Source/core/platform/network/FormData.h
index 95cdbab1dc876895d09cd20eff2ab1c6716108e0..1215941c3d367d177cfb0eca1235a76877015b46 100644
--- a/Source/core/platform/network/FormData.h
+++ b/Source/core/platform/network/FormData.h
@@ -20,6 +20,7 @@
#ifndef FormData_h
#define FormData_h
+#include "core/platform/network/BlobData.h"
#include "weborigin/KURL.h"
#include "wtf/Forward.h"
#include "wtf/RefCounted.h"
@@ -32,6 +33,7 @@ class TextEncoding;
namespace WebCore {
+class BlobDataHandle;
class FormDataList;
class FormDataElement {
@@ -40,18 +42,20 @@ public:
explicit FormDataElement(const Vector<char>& array) : m_type(data), m_data(array) { }
FormDataElement(const String& filename, long long fileStart, long long fileLength, double expectedFileModificationTime) : m_type(encodedFile), m_filename(filename), m_fileStart(fileStart), m_fileLength(fileLength), m_expectedFileModificationTime(expectedFileModificationTime) { }
- explicit FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_url(blobURL) { }
- FormDataElement(const KURL& url, long long start, long long length, double expectedFileModificationTime) : m_type(encodedURL), m_url(url), m_fileStart(start), m_fileLength(length), m_expectedFileModificationTime(expectedFileModificationTime) { }
+ explicit FormDataElement(const String& blobUUID, PassRefPtr<BlobDataHandle> optionalHandle) : m_type(encodedBlob), m_blobUUID(blobUUID), m_optionalBlobDataHandle(optionalHandle) { }
+ FormDataElement(const KURL& fileSystemURL, long long start, long long length, double expectedFileModificationTime) : m_type(encodedFileSystemURL), m_fileSystemURL(fileSystemURL), m_fileStart(start), m_fileLength(length), m_expectedFileModificationTime(expectedFileModificationTime) { }
enum Type {
data,
- encodedFile
- , encodedBlob
- , encodedURL
+ encodedFile,
+ encodedBlob,
+ encodedFileSystemURL
} m_type;
Vector<char> m_data;
String m_filename;
- KURL m_url; // For Blob or URL.
+ String m_blobUUID;
+ RefPtr<BlobDataHandle> m_optionalBlobDataHandle;
+ KURL m_fileSystemURL;
long long m_fileStart;
long long m_fileLength;
double m_expectedFileModificationTime;
@@ -69,9 +73,9 @@ inline bool operator==(const FormDataElement& a, const FormDataElement& b)
if (a.m_type == FormDataElement::encodedFile)
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_url == b.m_url;
- if (a.m_type == FormDataElement::encodedURL)
- return a.m_url == b.m_url;
+ return a.m_blobUUID == b.m_blobUUID;
+ if (a.m_type == FormDataElement::encodedFileSystemURL)
+ return a.m_fileSystemURL == b.m_fileSystemURL;
return true;
}
@@ -102,9 +106,9 @@ public:
void appendData(const void* data, size_t);
void appendFile(const String& filePath);
void appendFileRange(const String& filename, long long start, long long length, double expectedModificationTime);
- void appendBlob(const KURL& blobURL);
- void appendURL(const KURL&);
- void appendURLRange(const KURL&, long long start, long long length, double expectedModificationTime);
+ void appendBlob(const String& blobUUID, PassRefPtr<BlobDataHandle> optionalHandle);
+ void appendFileSystemURL(const KURL&);
+ void appendFileSystemURLRange(const KURL&, long long start, long long length, double expectedModificationTime);
void flatten(Vector<char>&) const; // omits files
String flattenToString() const; // omits files
« no previous file with comments | « Source/core/platform/network/BlobData.cpp ('k') | Source/core/platform/network/FormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698