Index: WebCore/fileapi/Blob.h |
=================================================================== |
--- WebCore/fileapi/Blob.h (revision 140218) |
+++ WebCore/fileapi/Blob.h (working copy) |
@@ -32,7 +32,6 @@ |
#define Blob_h |
#include "BlobData.h" |
-#include "KURL.h" |
#include "ScriptWrappable.h" |
#include <wtf/PassOwnPtr.h> |
#include <wtf/PassRefPtr.h> |
@@ -48,46 +47,33 @@ |
public: |
static PassRefPtr<Blob> create() |
{ |
- return adoptRef(new Blob); |
+ return adoptRef(new Blob(BlobDataHandle::create())); |
} |
- static PassRefPtr<Blob> create(PassOwnPtr<BlobData> blobData, long long size) |
+ static PassRefPtr<Blob> create(PassRefPtr<BlobDataHandle> blobDataHandle) |
{ |
- return adoptRef(new Blob(blobData, size)); |
+ return adoptRef(new Blob(blobDataHandle)); |
} |
- // For deserialization. |
- static PassRefPtr<Blob> create(const KURL& srcURL, const String& type, long long size) |
- { |
- return adoptRef(new Blob(srcURL, type, size)); |
- } |
- |
virtual ~Blob(); |
- const KURL& url() const { return m_internalURL; } |
- const String& type() const { return m_type; } |
- |
- virtual unsigned long long size() const { return static_cast<unsigned long long>(m_size); } |
+ String uuid() const { return m_blobDataHandle->uuid(); } |
+ String type() const { return m_blobDataHandle->type(); } |
+ virtual unsigned long long size() const { return m_blobDataHandle->size(); } |
virtual bool isFile() const { return false; } |
+ PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle; } |
+ |
#if ENABLE(BLOB) |
PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_limits<long long>::max(), const String& contentType = String()) const; |
#endif |
protected: |
- Blob(); |
- Blob(PassOwnPtr<BlobData>, long long size); |
+ Blob(PassRefPtr<BlobDataHandle>); |
- // For deserialization. |
- Blob(const KURL& srcURL, const String& type, long long size); |
- |
- // This is an internal URL referring to the blob data associated with this object. It serves |
- // as an identifier for this blob. The internal URL is never used to source the blob's content |
- // into an HTML or for FileRead'ing, public blob URLs must be used for those purposes. |
- KURL m_internalURL; |
- |
- String m_type; |
- long long m_size; |
+private: |
+ Blob(); |
+ RefPtr<BlobDataHandle> m_blobDataHandle; |
}; |
} // namespace WebCore |