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

Side by Side Diff: Source/platform/FileMetadata.h

Issue 882343002: Upgrade Blink to milliseconds-based last modified filetimes, part 5. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sof-fileinfo-modtime-in-ms-3
Patch Set: rebased 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 unified diff | Download patch
« no previous file with comments | « Source/modules/filesystem/Metadata.h ('k') | Source/platform/FileMetadata.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 27 matching lines...) Expand all
38 #include <time.h> 38 #include <time.h>
39 39
40 namespace blink { 40 namespace blink {
41 41
42 inline double invalidFileTime() { return std::numeric_limits<double>::quiet_NaN( ); } 42 inline double invalidFileTime() { return std::numeric_limits<double>::quiet_NaN( ); }
43 inline bool isValidFileTime(double time) { return std::isfinite(time); } 43 inline bool isValidFileTime(double time) { return std::isfinite(time); }
44 44
45 class FileMetadata { 45 class FileMetadata {
46 public: 46 public:
47 FileMetadata() 47 FileMetadata()
48 : modificationTimeMS(invalidFileTime()) 48 : modificationTime(invalidFileTime())
49 , length(-1) 49 , length(-1)
50 , type(TypeUnknown) 50 , type(TypeUnknown)
51 { 51 {
52 } 52 }
53 53
54 // The last modification time of the file, in milliseconds. 54 // The last modification time of the file, in milliseconds.
55 // The value NaN means that the time is not known. 55 // The value NaN means that the time is not known.
56 double modificationTimeMS; 56 double modificationTime;
57 57
58 // The length of the file in bytes. 58 // The length of the file in bytes.
59 // The value -1 means that the length is not set. 59 // The value -1 means that the length is not set.
60 long long length; 60 long long length;
61 61
62 enum Type { 62 enum Type {
63 TypeUnknown = 0, 63 TypeUnknown = 0,
64 TypeFile, 64 TypeFile,
65 TypeDirectory 65 TypeDirectory
66 }; 66 };
67 67
68 Type type; 68 Type type;
69 String platformPath; 69 String platformPath;
70 }; 70 };
71 71
72 PLATFORM_EXPORT bool getFileSize(const String&, long long& result); 72 PLATFORM_EXPORT bool getFileSize(const String&, long long& result);
73 PLATFORM_EXPORT bool getFileModificationTime(const String&, double& result); 73 PLATFORM_EXPORT bool getFileModificationTime(const String&, double& result);
74 PLATFORM_EXPORT bool getFileMetadata(const String&, FileMetadata&); 74 PLATFORM_EXPORT bool getFileMetadata(const String&, FileMetadata&);
75 PLATFORM_EXPORT String directoryName(const String&); 75 PLATFORM_EXPORT String directoryName(const String&);
76 PLATFORM_EXPORT KURL filePathToURL(const String&); 76 PLATFORM_EXPORT KURL filePathToURL(const String&);
77 77
78 } // namespace blink 78 } // namespace blink
79 79
80 #endif // FileMetadata_h 80 #endif // FileMetadata_h
OLDNEW
« 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