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

Unified Diff: Source/core/platform/network/BlobData.cpp

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.h ('k') | Source/core/platform/network/FormData.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/platform/network/BlobData.cpp
diff --git a/Source/core/platform/network/BlobData.cpp b/Source/core/platform/network/BlobData.cpp
index 9b9ab9070645290120859ff452f92899e376fe15..2818372880e95d9900a1ee32ed8bfb8331cae381 100644
--- a/Source/core/platform/network/BlobData.cpp
+++ b/Source/core/platform/network/BlobData.cpp
@@ -32,7 +32,7 @@
#include "core/platform/network/BlobData.h"
#include "core/fileapi/BlobRegistry.h"
-#include "core/fileapi/BlobURL.h"
+#include "platform/UUID.h"
#include "wtf/OwnPtr.h"
#include "wtf/PassOwnPtr.h"
#include "wtf/PassRefPtr.h"
@@ -55,7 +55,7 @@ void BlobDataItem::detachFromCurrentThread()
{
data->detachFromCurrentThread();
path = path.isolatedCopy();
- url = url.copy();
+ fileSystemURL = fileSystemURL.copy();
}
PassOwnPtr<BlobData> BlobData::create()
@@ -86,12 +86,12 @@ void BlobData::appendFile(const String& path, long long offset, long long length
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> dataHandle, long long offset, long long length)
{
- m_items.append(BlobDataItem(url, offset, length));
+ m_items.append(BlobDataItem(dataHandle, offset, length));
}
-void BlobData::appendURL(const KURL& url, long long offset, long long length, double expectedModificationTime)
+void BlobData::appendFileSystemURL(const KURL& url, long long offset, long long length, double expectedModificationTime)
{
m_items.append(BlobDataItem(url, offset, length, expectedModificationTime));
}
@@ -101,17 +101,32 @@ void BlobData::swapItems(BlobDataItemList& items)
m_items.swap(items);
}
+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)
{
- UNUSED_PARAM(size);
- m_internalURL = BlobURL::createInternalURL();
- BlobRegistry::registerBlobURL(m_internalURL, data);
+ BlobRegistry::addBlobDataRef(m_uuid);
}
BlobDataHandle::~BlobDataHandle()
{
- BlobRegistry::unregisterBlobURL(m_internalURL);
+ BlobRegistry::removeBlobDataRef(m_uuid);
}
} // namespace WebCore
« no previous file with comments | « Source/core/platform/network/BlobData.h ('k') | Source/core/platform/network/FormData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698