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

Unified Diff: WebCore/fileapi/File.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/fileapi/File.h ('k') | WebCore/fileapi/FileReader.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: WebCore/fileapi/File.cpp
===================================================================
--- WebCore/fileapi/File.cpp (revision 140218)
+++ WebCore/fileapi/File.cpp (working copy)
@@ -80,7 +80,7 @@
{
OwnPtr<BlobData> blobData = BlobData::create();
blobData->setContentType(getContentTypeFromFileName(fileSystemURL.path(), File::WellKnownContentTypes));
- blobData->appendURL(fileSystemURL, 0, metadata.length, metadata.modificationTime);
+ blobData->appendFileSystemURL(fileSystemURL, 0, metadata.length, metadata.modificationTime);
return blobData.release();
}
#endif
@@ -95,7 +95,7 @@
#endif
File::File(const String& path, ContentTypeLookupPolicy policy)
- : Blob(createBlobDataForFile(path, policy), -1)
+ : Blob(BlobDataHandle::create(createBlobDataForFile(path, policy), -1))
, m_path(path)
, m_name(pathGetFileName(path))
#if ENABLE(FILE_SYSTEM)
@@ -105,8 +105,8 @@
{
}
-File::File(const String& path, const KURL& url, const String& type)
- : Blob(url, type, -1)
+File::File(const String& path, const String& uuid, const String& type)
+ : Blob(BlobDataHandle::create(uuid, type, -1))
, m_path(path)
#if ENABLE(FILE_SYSTEM)
, m_snapshotSize(-1)
@@ -120,7 +120,7 @@
}
File::File(const String& path, const String& name, ContentTypeLookupPolicy policy)
- : Blob(createBlobDataForFileWithName(path, name, policy), -1)
+ : Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, policy), -1))
, m_path(path)
, m_name(name)
#if ENABLE(FILE_SYSTEM)
@@ -130,9 +130,23 @@
{
}
+File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle)
+ : Blob(blobDataHandle)
+ , m_path(path)
#if ENABLE(FILE_SYSTEM)
+ , m_snapshotSize(-1)
+ , m_snapshotModificationTime(invalidFileTime())
+#endif
+{
+ m_name = pathGetFileName(path);
+ // FIXME: File object serialization/deserialization does not include
+ // newer file object data members: m_name and m_relativePath.
+ // See SerializedScriptValue.cpp for js and v8.
+}
+
+#if ENABLE(FILE_SYSTEM)
File::File(const String& name, const FileMetadata& metadata)
- : Blob(createBlobDataForFileWithMetadata(name, metadata), metadata.length)
+ : Blob(BlobDataHandle::create(createBlobDataForFileWithMetadata(name, metadata), metadata.length))
, m_path(metadata.platformPath)
, m_name(name)
, m_snapshotSize(metadata.length)
@@ -141,7 +155,7 @@
}
File::File(const KURL& fileSystemURL, const FileMetadata& metadata)
- : Blob(createBlobDataForFileSystemURL(fileSystemURL, metadata), metadata.length)
+ : Blob(BlobDataHandle::create(createBlobDataForFileSystemURL(fileSystemURL, metadata), metadata.length))
, m_fileSystemURL(fileSystemURL)
, m_snapshotSize(metadata.length)
, m_snapshotModificationTime(metadata.modificationTime)
« no previous file with comments | « WebCore/fileapi/File.h ('k') | WebCore/fileapi/FileReader.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698