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

Unified Diff: Source/core/fileapi/File.cpp

Issue 57483002: Implement File constructor. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressed most feedback. Created 7 years, 1 month 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 | « Source/core/fileapi/File.h ('k') | Source/core/fileapi/File.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/fileapi/File.cpp
diff --git a/Source/core/fileapi/File.cpp b/Source/core/fileapi/File.cpp
index 02d970030e80e3217c0757c910f57944e7c96330..684216160e44ee501cdacc56b3981e91449974fa 100644
--- a/Source/core/fileapi/File.cpp
+++ b/Source/core/fileapi/File.cpp
@@ -94,6 +94,7 @@ PassRefPtr<File> File::createWithRelativePath(const String& path, const String&
File::File(const String& path, ContentTypeLookupPolicy policy)
: Blob(BlobDataHandle::create(createBlobDataForFile(path, policy), -1))
+ , m_hasBackingFile(true)
, m_path(path)
, m_name(blink::Platform::current()->fileUtilities()->baseName(path))
, m_snapshotSize(-1)
@@ -104,6 +105,7 @@ File::File(const String& path, ContentTypeLookupPolicy policy)
File::File(const String& path, const String& name, ContentTypeLookupPolicy policy)
: Blob(BlobDataHandle::create(createBlobDataForFileWithName(path, name, policy), -1))
+ , m_hasBackingFile(true)
, m_path(path)
, m_name(name)
, m_snapshotSize(-1)
@@ -114,6 +116,7 @@ File::File(const String& path, const String& name, ContentTypeLookupPolicy polic
File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle)
: Blob(blobDataHandle)
+ , m_hasBackingFile(true)
, m_path(path)
, m_name(blink::Platform::current()->fileUtilities()->baseName(path))
, m_snapshotSize(-1)
@@ -125,8 +128,19 @@ File::File(const String& path, PassRefPtr<BlobDataHandle> blobDataHandle)
// See SerializedScriptValue.cpp.
}
+File::File(const String& name, double modificationTime, PassRefPtr<BlobDataHandle> blobDataHandle)
+ : Blob(blobDataHandle)
+ , m_hasBackingFile(false)
+ , m_name(name)
+ , m_snapshotSize(Blob::size())
+ , m_snapshotModificationTime(modificationTime)
+{
+ ScriptWrappable::init(this);
+}
+
File::File(const String& name, const FileMetadata& metadata)
: Blob(BlobDataHandle::create(createBlobDataForFileWithMetadata(name, metadata), metadata.length))
+ , m_hasBackingFile(true)
, m_path(metadata.platformPath)
, m_name(name)
, m_snapshotSize(metadata.length)
@@ -137,6 +151,7 @@ File::File(const String& name, const FileMetadata& metadata)
File::File(const KURL& fileSystemURL, const FileMetadata& metadata)
: Blob(BlobDataHandle::create(createBlobDataForFileSystemURL(fileSystemURL, metadata), metadata.length))
+ , m_hasBackingFile(true)
, m_fileSystemURL(fileSystemURL)
, m_snapshotSize(metadata.length)
, m_snapshotModificationTime(metadata.modificationTime)
« no previous file with comments | « Source/core/fileapi/File.h ('k') | Source/core/fileapi/File.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698