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

Unified Diff: Source/core/fileapi/File.cpp

Issue 157363003: Implement Blob.close(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Tweak comment 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
Index: Source/core/fileapi/File.cpp
diff --git a/Source/core/fileapi/File.cpp b/Source/core/fileapi/File.cpp
index de776d5acfee62729976119c903e6f667c9a3112..c23d682314f7331f46e4e8826ccc87dfcf4a2be3 100644
--- a/Source/core/fileapi/File.cpp
+++ b/Source/core/fileapi/File.cpp
@@ -225,6 +225,21 @@ void File::captureSnapshot(long long& snapshotSize, double& snapshotModification
snapshotModificationTime = metadata.modificationTime;
}
+void File::close(ExecutionContext* executionContext)
+{
+ if (!hasBeenClosed()) {
+ // Reset the File to its closed representation, an empty
+ // Blob. The name isn't cleared, as it should still be
+ // available.
+ m_hasBackingFile = false;
+ m_path = String();
+ m_fileSystemURL = KURL();
+ invalidateSnapshotMetadata();
+ m_relativePath = String();
+ Blob::close(executionContext);
+ }
+}
+
void File::appendTo(BlobData& blobData) const
{
if (!m_hasBackingFile) {

Powered by Google App Engine
This is Rietveld 408576698