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) |