Chromium Code Reviews| Index: Source/core/fileapi/Blob.h |
| diff --git a/Source/core/fileapi/Blob.h b/Source/core/fileapi/Blob.h |
| index 958aa283bb1cfbf66c9e73317fd59652f8f76c59..7db70c71410a354c177d44648be564fdd2660caf 100644 |
| --- a/Source/core/fileapi/Blob.h |
| +++ b/Source/core/fileapi/Blob.h |
| @@ -34,7 +34,6 @@ |
| #include "bindings/v8/ScriptWrappable.h" |
| #include "core/html/URLRegistry.h" |
| #include "core/platform/network/BlobData.h" |
| -#include "weborigin/KURL.h" |
| #include "wtf/PassOwnPtr.h" |
| #include "wtf/PassRefPtr.h" |
| #include "wtf/RefCounted.h" |
| @@ -48,47 +47,32 @@ class Blob : public ScriptWrappable, public URLRegistrable, public RefCounted<Bl |
| 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)); |
| - } |
| - |
| - // For deserialization. |
| - static PassRefPtr<Blob> create(const KURL& srcURL, const String& type, long long size) |
| - { |
| - return adoptRef(new Blob(srcURL, type, size)); |
| + return adoptRef(new Blob(blobDataHandle)); |
| } |
| 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; } |
| + PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_limits<long long>::max(), const String& contentType = String()) const; |
| - // URLRegistrable |
| + // URLRegistrable to support PublicURLs. |
| virtual URLRegistry& registry() const OVERRIDE; |
| - PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_limits<long long>::max(), const String& contentType = String()) const; |
| - |
| protected: |
| - Blob(); |
| - Blob(PassOwnPtr<BlobData>, long long size); |
| - |
| - // For deserialization. |
| - Blob(const KURL& srcURL, const String& type, long long size); |
| + Blob(PassRefPtr<BlobDataHandle>); |
|
kinuko
2013/10/02 15:41:39
explicit
michaeln
2013/10/02 20:09:01
Done.
|
| - // 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 |