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

Unified Diff: WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp

Issue 11192017: ********** WebCore blob hacking (Closed) Base URL: http://svn.webkit.org/repository/webkit/trunk/Source/
Patch Set: Created 7 years, 11 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: WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp
===================================================================
--- WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp (revision 140218)
+++ WebKit/chromium/src/WebFileSystemCallbacksImpl.cpp (working copy)
@@ -76,6 +76,27 @@
delete this;
}
+void WebFileSystemCallbacksImpl::didCreateSnapshotFile(const WebFileInfo& webFileInfo)
+{
+ // It's important to create a BlobDataHandle that refers to the platform file path prior
+ // to return from this method so the underlying file will not be deleted.
+ OwnPtr<BlobData> blobData = BlobData::create();
+ blobData->appendFile(webFileInfo.platformPath);
+ RefPtr<BlobDataHandle> snapshotBlob = BlobDataHandle::create(blobData.release(), webFileInfo.length);
+ didCreateSnapshotFile(webFileInfo, snapshotBlob);
+}
+
+void WebFileSystemCallbacksImpl::didCreateSnapshotFile(const WebFileInfo& webFileInfo, PassRefPtr<WebCore::BlobDataHandle> snapshot)
+{
+ FileMetadata fileMetadata;
+ fileMetadata.modificationTime = webFileInfo.modificationTime;
+ fileMetadata.length = webFileInfo.length;
+ fileMetadata.type = static_cast<FileMetadata::Type>(webFileInfo.type);
+ fileMetadata.platformPath = webFileInfo.platformPath;
+ m_callbacks->didCreateSnapshotFile(fileMetadata, snapshot);
+ delete this;
+}
+
void WebFileSystemCallbacksImpl::didReadDirectory(const WebVector<WebFileSystemEntry>& entries, bool hasMore)
{
for (size_t i = 0; i < entries.size(); ++i)
« no previous file with comments | « WebKit/chromium/src/WebFileSystemCallbacksImpl.h ('k') | WebKit/chromium/src/WorkerAsyncFileSystemChromium.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698