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

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

Issue 157363003: Implement Blob.close(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 10 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/dom/DOMURL.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 e564a6514c28a6bf48f453cd7637671155a65865..f63761cb63ff7352bba4f0816be78e9db5813a0e 100644
--- a/Source/core/fileapi/Blob.h
+++ b/Source/core/fileapi/Blob.h
@@ -59,14 +59,16 @@ public:
virtual unsigned long long size() const { return m_blobDataHandle->size(); }
virtual PassRefPtr<Blob> slice(long long start = 0, long long end = std::numeric_limits<long long>::max(), const String& contentType = String()) const;
+ virtual void close(ExecutionContext*);
- String type() const { return m_blobDataHandle->type(); }
+ String type() const { return m_blobDataHandle->type(); }
String uuid() const { return m_blobDataHandle->uuid(); }
PassRefPtr<BlobDataHandle> blobDataHandle() const { return m_blobDataHandle; }
// True for all File instances, including the user-built ones.
virtual bool isFile() const { return false; }
// Only true for File instances that are backed by platform files.
virtual bool hasBackingFile() const { return false; }
+ bool hasBeenClosed() const { return m_hasBeenClosed; }
// Used by the JavaScript Blob and File constructors.
virtual void appendTo(BlobData&) const;
@@ -74,13 +76,15 @@ public:
// URLRegistrable to support PublicURLs.
virtual URLRegistry& registry() const OVERRIDE FINAL;
- static void clampSliceOffsets(long long size, long long& start, long long& end);
protected:
explicit Blob(PassRefPtr<BlobDataHandle>);
+ static void clampSliceOffsets(long long size, long long& start, long long& end);
private:
Blob();
+
RefPtr<BlobDataHandle> m_blobDataHandle;
+ bool m_hasBeenClosed;
};
} // namespace WebCore
« no previous file with comments | « Source/core/dom/DOMURL.cpp ('k') | Source/core/fileapi/Blob.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698