Index: Source/core/fileapi/File.cpp |
diff --git a/Source/core/fileapi/File.cpp b/Source/core/fileapi/File.cpp |
index afdc11ce20ef6f4d61def78a32a3bc58be7eaa21..5b10bd836197b95bc2ef21b73b93126f0248dc1e 100644 |
--- a/Source/core/fileapi/File.cpp |
+++ b/Source/core/fileapi/File.cpp |
@@ -165,7 +165,7 @@ File::File(const KURL& fileSystemURL, const FileMetadata& metadata) |
ScriptWrappable::init(this); |
} |
-double File::lastModifiedDate() const |
+double File::lastModifiedMS() const |
{ |
if (hasValidSnapshotMetadata() && isValidFileTime(m_snapshotModificationTime)) |
return m_snapshotModificationTime * msPerSecond; |
@@ -177,6 +177,32 @@ double File::lastModifiedDate() const |
return currentTime() * msPerSecond; |
} |
+long long File::lastModified() const |
+{ |
+ double modifiedDate = lastModifiedMS(); |
+ |
+ // The getter should return the current time when the last modification time isn't known. |
+ if (!isValidFileTime(modifiedDate)) |
+ modifiedDate = currentTimeMS(); |
+ |
+ // lastModified returns a number, not a Date instance, |
+ // http://dev.w3.org/2006/webapi/FileAPI/#file-attrs |
+ return floor(modifiedDate); |
+} |
+ |
+double File::lastModifiedDate() const |
+{ |
+ double modifiedDate = lastModifiedMS(); |
+ |
+ // The getter should return the current time when the last modification time isn't known. |
+ if (!isValidFileTime(modifiedDate)) |
+ modifiedDate = currentTimeMS(); |
+ |
+ // lastModifiedDate returns a Date instance, |
+ // http://www.w3.org/TR/FileAPI/#dfn-lastModifiedDate |
+ return modifiedDate; |
+} |
+ |
unsigned long long File::size() const |
{ |
if (hasValidSnapshotMetadata()) |