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

Unified Diff: Source/platform/FileMetadata.h

Issue 884393002: Upgrade Blink to milliseconds-based last modified filetimes, part 3. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sof-fileinfo-modtime-in-ms-1
Patch Set: Stop using time_t over getFileModificationTime(); not sound Created 5 years, 10 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 | « Source/modules/filesystem/Metadata.h ('k') | Source/platform/FileMetadata.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/FileMetadata.h
diff --git a/Source/platform/FileMetadata.h b/Source/platform/FileMetadata.h
index 924082dcb7e31dc8feb025293ea161f323ec9897..b2507b4cbdbfb8f99eb2b685b69da14d9bab7877 100644
--- a/Source/platform/FileMetadata.h
+++ b/Source/platform/FileMetadata.h
@@ -42,10 +42,18 @@ namespace blink {
inline double invalidFileTime() { return std::numeric_limits<double>::quiet_NaN(); }
inline bool isValidFileTime(double time) { return std::isfinite(time); }
-struct FileMetadata {
- // The last modification time of the file, in seconds.
- // The value 0.0 means that the time is not set.
- double modificationTime;
+class FileMetadata {
+public:
+ FileMetadata()
+ : modificationTimeMS(invalidFileTime())
+ , length(-1)
+ , type(TypeUnknown)
+ {
+ }
+
+ // The last modification time of the file, in milliseconds.
+ // The value NaN means that the time is not known.
+ double modificationTimeMS;
// The length of the file in bytes.
// The value -1 means that the length is not set.
@@ -59,12 +67,10 @@ struct FileMetadata {
Type type;
String platformPath;
-
- FileMetadata() : modificationTime(invalidFileTime()), length(-1), type(TypeUnknown) { }
};
PLATFORM_EXPORT bool getFileSize(const String&, long long& result);
-PLATFORM_EXPORT bool getFileModificationTime(const String&, time_t& result);
+PLATFORM_EXPORT bool getFileModificationTime(const String&, double& result);
PLATFORM_EXPORT bool getFileMetadata(const String&, FileMetadata&);
PLATFORM_EXPORT String directoryName(const String&);
PLATFORM_EXPORT KURL filePathToURL(const String&);
« no previous file with comments | « Source/modules/filesystem/Metadata.h ('k') | Source/platform/FileMetadata.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698