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

Unified Diff: Source/core/fileapi/Blob.h

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/bindings/v8/SerializedScriptValue.cpp ('k') | Source/core/fileapi/Blob.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fileapi/Blob.h
diff --git a/Source/core/fileapi/Blob.h b/Source/core/fileapi/Blob.h
index 254d2bbd597166fc4ac1157e192e007f92e01f63..3d46a1addeb00494a691c60742b1826074281105 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);
+ explicit Blob(PassRefPtr<BlobDataHandle>);
- // 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
« no previous file with comments | « Source/bindings/v8/SerializedScriptValue.cpp ('k') | Source/core/fileapi/Blob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698