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

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

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/BlobData.h ('k') | WebCore/platform/network/BlobRegistry.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/platform/network/BlobData.cpp
===================================================================
--- WebCore/platform/network/BlobData.cpp (revision 140218)
+++ WebCore/platform/network/BlobData.cpp (working copy)
@@ -31,6 +31,8 @@
#include "config.h"
#include "BlobData.h"
+#include "BlobRegistry.h"
+#include "UUID.h"
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/PassRefPtr.h>
@@ -53,7 +55,7 @@
{
data->detachFromCurrentThread();
path = path.isolatedCopy();
- url = url.copy();
+ fileSystemURL = fileSystemURL.copy();
}
PassOwnPtr<BlobData> BlobData::create()
@@ -84,15 +86,15 @@
m_items.append(BlobDataItem(path, offset, length, expectedModificationTime));
}
-void BlobData::appendBlob(const KURL& url, long long offset, long long length)
+void BlobData::appendBlob(PassRefPtr<BlobDataHandle> blobDataHandle, long long offset, long long length)
{
- m_items.append(BlobDataItem(url, offset, length));
+ m_items.append(BlobDataItem(blobDataHandle, offset, length));
}
#if ENABLE(FILE_SYSTEM)
-void BlobData::appendURL(const KURL& url, long long offset, long long length, double expectedModificationTime)
+void BlobData::appendFileSystemURL(const KURL& fileSystemURL, long long offset, long long length, double expectedModificationTime)
{
- m_items.append(BlobDataItem(url, offset, length, expectedModificationTime));
+ m_items.append(BlobDataItem(fileSystemURL, offset, length, expectedModificationTime));
}
#endif
@@ -101,4 +103,37 @@
m_items.swap(items);
}
+
+// TODO: Maybe we could/should embed the 'type' and 'size' into the id value too?
+// In some place we pass just the string id value around and in those places
+// we have no way of reconstructing the 'type' and 'size'.
+
+BlobDataHandle::BlobDataHandle()
+ : m_uuid(createCanonicalUUIDString())
+ , m_size(0)
+{
+ blobRegistry().registerBlobData(m_uuid, BlobData::create());
+}
+
+BlobDataHandle::BlobDataHandle(PassOwnPtr<BlobData> data, long long size)
+ : m_uuid(createCanonicalUUIDString())
+ , m_type(data->contentType().isolatedCopy())
+ , m_size(size)
+{
+ blobRegistry().registerBlobData(m_uuid, data);
+}
+
+BlobDataHandle::BlobDataHandle(const String& uuid, const String& type, long long size)
+ : m_uuid(uuid.isolatedCopy())
+ , m_type(type.isolatedCopy())
+ , m_size(size)
+{
+ blobRegistry().addBlobDataRef(m_uuid);
+}
+
+BlobDataHandle::~BlobDataHandle()
+{
+ blobRegistry().removeBlobDataRef(m_uuid);
+}
+
} // namespace WebCore
« no previous file with comments | « WebCore/platform/network/BlobData.h ('k') | WebCore/platform/network/BlobRegistry.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698