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

Unified Diff: WebCore/platform/network/FormData.h

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 7 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 | « WebCore/platform/network/BlobStorageData.h ('k') | WebCore/platform/network/FormData.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/network/FormData.h
===================================================================
--- WebCore/platform/network/FormData.h (revision 140218)
+++ WebCore/platform/network/FormData.h (working copy)
@@ -20,6 +20,7 @@
#ifndef FormData_h
#define FormData_h
+#include "BlobData.h"
#include "KURL.h"
#include <wtf/Forward.h>
#include <wtf/RefCounted.h>
@@ -28,6 +29,7 @@
namespace WebCore {
+class BlobDataHandle;
class Document;
class FormDataList;
class TextEncoding;
@@ -39,12 +41,12 @@
#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) { }
- explicit FormDataElement(const KURL& blobURL) : m_type(encodedBlob), m_url(blobURL) { }
+ explicit FormDataElement( const String& blobUUID, PassRefPtr<BlobDataHandle> optionalblobDataHandle) : m_type(encodedBlob), m_optionalBlobDataHandle(optionalblobDataHandle) { }
#else
FormDataElement(const String& filename, bool shouldGenerateFile) : m_type(encodedFile), m_filename(filename), m_shouldGenerateFile(shouldGenerateFile) { }
#endif
#if ENABLE(FILE_SYSTEM)
- 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), m_shouldGenerateFile(false) { }
+ 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), m_shouldGenerateFile(false) { }
#endif
void reportMemoryUsage(MemoryObjectInfo*) const;
@@ -56,13 +58,15 @@
, encodedBlob
#endif
#if ENABLE(FILE_SYSTEM)
- , encodedURL
+ , encodedFileSystemURL
#endif
} m_type;
Vector<char> m_data;
String m_filename;
#if ENABLE(BLOB)
- 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;
@@ -84,13 +88,13 @@
#if ENABLE(BLOB)
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;
+ return a.m_blobUUID == b.m_blobUUID;
#else
return a.m_filename == b.m_filename;
#endif
#if ENABLE(FILE_SYSTEM)
- if (a.m_type == FormDataElement::encodedURL)
- return a.m_url == b.m_url;
+ if (a.m_type == FormDataElement::encodedFileSystemURL)
+ return a.m_fileSystemURL == b.m_fileSystemURL;
#endif
return true;
@@ -126,7 +130,7 @@
void appendFile(const String& filePath, 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);
+ void appendBlob(const String& blobUUID, PassRefPtr<BlobDataHandle> optionalBlobDataHandle);
#endif
#if ENABLE(FILE_SYSTEM)
void appendURL(const KURL&);
@@ -137,10 +141,14 @@
String flattenToString() const; // omits files
#if ENABLE(BLOB)
+#if PLATFORM(CHROMIUM)
+ // Chromium doesn't store blob data in renderer processes.
+#else
// Resolve all blob references so we only have file and data.
// If the FormData has no blob references to resolve, this is returned.
PassRefPtr<FormData> resolveBlobReferences();
#endif
+#endif
bool isEmpty() const { return m_elements.isEmpty(); }
const Vector<FormDataElement>& elements() const { return m_elements; }
« no previous file with comments | « WebCore/platform/network/BlobStorageData.h ('k') | WebCore/platform/network/FormData.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698