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

Unified Diff: WebCore/Modules/filesystem/DOMFileSystemSync.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
« no previous file with comments | « WebCore/Modules/filesystem/DOMFileSystem.cpp ('k') | WebCore/Modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/Modules/filesystem/DOMFileSystemSync.cpp
===================================================================
--- WebCore/Modules/filesystem/DOMFileSystemSync.cpp (revision 140218)
+++ WebCore/Modules/filesystem/DOMFileSystemSync.cpp (working copy)
@@ -113,10 +113,11 @@
{
}
- void didReadMetadata(const FileMetadata& metadata)
+ virtual void didCreateSnapshotFile(const FileMetadata& metadata, PassRefPtr<BlobDataHandle> snapshot)
{
// For regular filesystem types (temporary or persistent), we should not cache file metadata as it could change File semantics.
- // For other filesystem types (which could be platform-specific ones), there's a chance that the files are on remote filesystem. If the port has returned metadata just pass it to File constructor (so we may cache the metadata).
+ // For other filesystem types (which could be platform-specific ones), there's a chance that the files are on remote filesystem.
+ // If the port has returned metadata just pass it to File constructor (so we may cache the metadata).
// FIXME: We should use the snapshot metadata for all files.
// https://www.w3.org/Bugs/Public/show_bug.cgi?id=17746
if (m_type == FileSystemTypeTemporary || m_type == FileSystemTypePersistent) {
@@ -128,6 +129,12 @@
// Otherwise create a File from the FileSystem URL.
m_result->m_file = File::createForFileSystemFile(m_url, metadata).get();
}
+
+ // We can't directly use the snapshot blob data handle because the content type on it hasn't been set.
+ // Having a chain of custody thru thread bridging of that instance up until now, *after* we've coined a File with a new handle
+ // that has the correct type set on it, allows the blob storage system to track when a temp file can and can't
+ // be safely deleted.
+ // FIXME: Maybe add a BlobDataHandle/BlobRegistry methods to clone a blob with a new type?
}
private:
CreateFileHelper(PassRefPtr<CreateFileResult> result, const String& name, const KURL& url, FileSystemType type)
« no previous file with comments | « WebCore/Modules/filesystem/DOMFileSystem.cpp ('k') | WebCore/Modules/indexeddb/IDBObjectStore.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698