Changeset 119680 in webkit
- Timestamp:
- Jun 6, 2012, 9:34:40 PM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r119677 r119680 1 2012-06-06 Kinuko Yasuda <kinuko@chromium.org> 2 3 File::lastModifiedDate should use NaN or separate boolean flag for null Date value 4 https://bugs.webkit.org/show_bug.cgi?id=87826 5 6 Reviewed by Kent Tamura. 7 8 Test: http/tests/local/fileapi/file-last-modified-after-delete.html 9 10 * fileapi/File.cpp: 11 (WebCore::File::File): 12 (WebCore::File::captureSnapshot): 13 (WebCore::File::lastModifiedDate): 14 (WebCore::File::lastModifiedDateForBinding): Removed. 15 * fileapi/File.h: 16 (File): 17 * fileapi/File.idl: 18 * platform/FileMetadata.h: 19 (WebCore::FileMetadata::FileMetadata): 20 * platform/FileSystem.h: 21 * platform/chromium/support/WebHTTPBody.cpp: 22 (WebKit::WebHTTPBody::elementAt): 23 * platform/network/BlobData.cpp: 24 (WebCore): 25 1 26 2012-06-06 Sheriff Bot <webkit.review.bot@gmail.com> 2 27 -
trunk/Source/WebCore/fileapi/File.cpp
r118920 r119680 31 31 #include "MIMETypeRegistry.h" 32 32 #include <wtf/CurrentTime.h> 33 #include <wtf/MathExtras.h> 33 34 #include <wtf/text/WTFString.h> 34 35 … … 87 88 #if ENABLE(FILE_SYSTEM) 88 89 , m_snapshotSize(-1) 89 , m_snapshotModificationTime( 0)90 , m_snapshotModificationTime(invalidTime) 90 91 #endif 91 92 { … … 97 98 #if ENABLE(FILE_SYSTEM) 98 99 , m_snapshotSize(-1) 99 , m_snapshotModificationTime( 0)100 , m_snapshotModificationTime(invalidTime) 100 101 #endif 101 102 { … … 112 113 #if ENABLE(FILE_SYSTEM) 113 114 , m_snapshotSize(-1) 114 , m_snapshotModificationTime( 0)115 , m_snapshotModificationTime(invalidTime) 115 116 #endif 116 117 { … … 137 138 time_t modificationTime; 138 139 if (!getFileModificationTime(m_path, modificationTime)) 139 return 0;140 return invalidTime; 140 141 141 142 // Needs to return epoch time in milliseconds for Date. 142 143 return modificationTime * 1000.0; 143 }144 145 double File::lastModifiedDateForBinding() const146 {147 double value = lastModifiedDate();148 return (!value) ? std::numeric_limits<double>::quiet_NaN() : value;149 144 } 150 145 … … 179 174 if (!getFileMetadata(m_path, metadata)) { 180 175 snapshotSize = 0; 181 snapshotModificationTime = 0;176 snapshotModificationTime = invalidTime; 182 177 return; 183 178 } -
trunk/Source/WebCore/fileapi/File.h
r118920 r119680 78 78 const String& name() const { return m_name; } 79 79 80 // This may return zero if getFileModificationTime() platform call has failed or zero snapshot lastModifiedTime is given at construction time.80 // This may return NaN (which is converted to null Date in javascript layer) if getFileModificationTime() platform call has failed or the information is not available. 81 81 double lastModifiedDate() const; 82 83 // For binding. We want to return null Date if we get the value 0 Date (which is used to indicate the information is unavailable).84 double lastModifiedDateForBinding() const;85 82 86 83 #if ENABLE(DIRECTORY_UPLOAD) -
trunk/Source/WebCore/fileapi/File.idl
r118920 r119680 33 33 readonly attribute DOMString name; 34 34 #if !defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT 35 readonly attribute [ImplementedAs=lastModifiedDateForBinding]Date lastModifiedDate;35 readonly attribute Date lastModifiedDate; 36 36 #endif 37 37 #if defined(ENABLE_DIRECTORY_UPLOAD) && ENABLE_DIRECTORY_UPLOAD -
trunk/Source/WebCore/platform/FileMetadata.h
r118481 r119680 32 32 #define FileMetadata_h 33 33 34 #include "FileSystem.h" 34 35 #include <wtf/text/WTFString.h> 35 36 … … 57 58 #endif 58 59 59 FileMetadata() : modificationTime( 0.0), length(-1), type(TypeUnknown) { }60 FileMetadata() : modificationTime(invalidTime), length(-1), type(TypeUnknown) { } 60 61 }; 61 62 -
trunk/Source/WebCore/platform/FileSystem.h
r118481 r119680 146 146 }; 147 147 148 const double invalidTime = std::numeric_limits<double>::quiet_NaN(); 149 148 150 #if OS(WINDOWS) 149 151 static const char PlatformFilePathSeparator = '\\'; -
trunk/Source/WebCore/platform/chromium/support/WebHTTPBody.cpp
r112754 r119680 32 32 #include <public/WebHTTPBody.h> 33 33 34 #include "FileSystem.h" 34 35 #include "FormData.h" 35 36 … … 78 79 result.fileStart = 0; 79 80 result.fileLength = 0; 80 result.modificationTime = 0.0;81 result.modificationTime = invalidTime; 81 82 result.blobURL = KURL(); 82 83 -
trunk/Source/WebCore/platform/network/BlobData.cpp
r98316 r119680 31 31 #include "config.h" 32 32 #include "BlobData.h" 33 #include "FileSystem.h" 33 34 34 35 #include <wtf/OwnPtr.h> … … 41 42 42 43 const long long BlobDataItem::toEndOfFile = -1; 43 const double BlobDataItem::doNotCheckFileChange = 0;44 const double BlobDataItem::doNotCheckFileChange = invalidTime; 44 45 45 46 RawData::RawData()
Note:
See TracChangeset
for help on using the changeset viewer.