| Index: WebCore/platform/network/BlobData.cpp
|
| ===================================================================
|
| --- WebCore/platform/network/BlobData.cpp (revision 132804)
|
| +++ 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>
|
| @@ -84,9 +86,9 @@
|
| 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)
|
| @@ -101,4 +103,34 @@
|
| m_items.swap(items);
|
| }
|
|
|
| +// ------------- seperate file --------------------------------------
|
| +
|
| +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
|
|
|