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

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

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 8 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
Index: WebCore/platform/network/BlobData.h
===================================================================
--- WebCore/platform/network/BlobData.h (revision 132804)
+++ WebCore/platform/network/BlobData.h (working copy)
@@ -39,6 +39,8 @@
namespace WebCore {
+class BlobDataHandle;
+
class RawData : public ThreadSafeRefCounted<RawData> {
public:
static PassRefPtr<RawData> create()
@@ -101,9 +103,9 @@
}
// Constructor for Blob type.
- BlobDataItem(const KURL& url, long long offset, long long length)
+ BlobDataItem(PassRefPtr<BlobDataHandle> blobDataHandle, long long offset, long long length)
: type(Blob)
- , url(url)
+ , blobDataHandle(blobDataHandle)
, offset(offset)
, length(length)
, expectedModificationTime(invalidFileTime())
@@ -140,9 +142,12 @@
// For File type.
String path;
- // For Blob or URL type.
+ // For FileSystem URL type.
KURL url;
+ // For Blob type.
+ RefPtr<BlobDataHandle> blobDataHandle;
+
long long offset;
long long length;
double expectedModificationTime;
@@ -183,7 +188,7 @@
void appendData(PassRefPtr<RawData>, long long offset, long long length);
void appendFile(const String& path);
void appendFile(const String& path, long long offset, long long length, double expectedModificationTime);
- void appendBlob(const KURL&, long long offset, long long length);
+ void appendBlob(PassRefPtr<BlobDataHandle>, long long offset, long long length);
#if ENABLE(FILE_SYSTEM)
void appendURL(const KURL&, long long offset, long long length, double expectedModificationTime);
#endif
@@ -202,6 +207,45 @@
BlobDataItemList m_items;
};
+// TODO: BlobDataHandle s/b in a seperate file
+
+class BlobDataHandle : public ThreadSafeRefCounted<BlobDataHandle> {
+public:
+ // For empty blob construction.
+ static PassRefPtr<BlobDataHandle> create()
+ {
+ return new BlobDataHandle();
+ }
+
+ // For initial creation.
+ static PassRefPtr<BlobDataHandle> create(PassOwnPtr<BlobData> data, long long size)
+ {
+ return new BlobDataHandle(data, size);
+ }
+
+ // For deserialization.
+ static PassRefPtr<BlobDataHandle> create(const String& uuid, const String& type, long long size)
+ {
+ return new BlobDataHandle(uuid, type, size);
+ }
+
+ String uuid() const { return m_uuid.isolatedCopy(); }
+ String type() const { return m_type.isolatedCopy(); }
+ unsigned long long size() { return m_size; }
+
+ ~BlobDataHandle();
+
+private:
+ BlobDataHandle();
+ BlobDataHandle(PassOwnPtr<BlobData> data, long long size);
+ BlobDataHandle(const String& uuid, const String& type, long long size);
+
+ // FIXME: check that null or empty strings don't have some wierd thread affinity that isolatedCopy() doesn't evade???
+ const String m_uuid;
+ const String m_type;
+ const long long m_size;
+};
+
} // namespace WebCore
#endif // BlobData_h

Powered by Google App Engine
This is Rietveld 408576698