Index: Source/core/fileapi/BlobBuilder.cpp |
diff --git a/Source/core/fileapi/BlobBuilder.cpp b/Source/core/fileapi/BlobBuilder.cpp |
index 8be60c17f457fc44cbcd3860d14bce7dd0ed2539..f67a0217cc18ff608331fd1d545bddb8656b0399 100644 |
--- a/Source/core/fileapi/BlobBuilder.cpp |
+++ b/Source/core/fileapi/BlobBuilder.cpp |
@@ -94,7 +94,7 @@ void BlobBuilder::append(Blob* blob) |
{ |
if (!blob) |
return; |
- if (blob->isFile()) { |
+ if (blob->isOnFilesystem()) { |
File* file = toFile(blob); |
// If the blob is file that is not snapshoted, capture the snapshot now. |
// FIXME: This involves synchronous file operation. We need to figure out how to make it asynchronous. |
@@ -137,4 +137,19 @@ PassRefPtr<Blob> BlobBuilder::getBlob(const String& contentType) |
return blob; |
} |
+PassRefPtr<File> BlobBuilder::getFile(const String& contentType, const String& fileName, double modificationTime) |
+{ |
+ OwnPtr<BlobData> blobData = BlobData::create(); |
+ blobData->setContentType(contentType); |
+ blobData->swapItems(m_items); |
+ |
+ RefPtr<File> file = File::create(fileName, modificationTime, BlobDataHandle::create(blobData.release(), m_size)); |
+ |
+ // After creating a file from the current blob data, we do not need to keep the data around any more. |
+ // Instead, we only need to keep a reference to the blob data just created. |
+ m_items.append(BlobDataItem(file->blobDataHandle(), 0, m_size)); |
+ |
+ return file; |
Inactive
2013/11/04 14:13:11
nit: return file.release();
pwnall-personal
2013/11/04 17:16:25
Done.
Thank you!
To be honest, I replicated the p
|
+} |
+ |
} // namespace WebCore |