OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 Apple 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 , m_hasBackingFile(true) | 154 , m_hasBackingFile(true) |
155 , m_fileSystemURL(fileSystemURL) | 155 , m_fileSystemURL(fileSystemURL) |
156 , m_snapshotSize(metadata.length) | 156 , m_snapshotSize(metadata.length) |
157 , m_snapshotModificationTime(metadata.modificationTime) | 157 , m_snapshotModificationTime(metadata.modificationTime) |
158 { | 158 { |
159 ScriptWrappable::init(this); | 159 ScriptWrappable::init(this); |
160 } | 160 } |
161 | 161 |
162 double File::lastModifiedDate() const | 162 double File::lastModifiedDate() const |
163 { | 163 { |
164 if (hasValidSnapshotMetadata() && isValidFileTime(m_snapshotModificationTime
)) | 164 if (hasValidSnapshotMetadata()) |
165 return m_snapshotModificationTime * msPerSecond; | 165 return m_snapshotModificationTime * msPerSecond; |
166 | 166 |
167 time_t modificationTime; | 167 time_t modificationTime; |
168 if (getFileModificationTime(m_path, modificationTime) && isValidFileTime(mod
ificationTime)) | 168 if (getFileModificationTime(m_path, modificationTime) && isValidFileTime(mod
ificationTime)) |
169 return modificationTime * msPerSecond; | 169 return modificationTime * msPerSecond; |
170 | 170 |
171 return currentTime() * msPerSecond; | 171 return currentTime() * msPerSecond; |
172 } | 172 } |
173 | 173 |
174 unsigned long long File::size() const | 174 unsigned long long File::size() const |
(...skipping 24 matching lines...) Expand all Loading... |
199 snapshotSize = 0; | 199 snapshotSize = 0; |
200 snapshotModificationTime = invalidFileTime(); | 200 snapshotModificationTime = invalidFileTime(); |
201 return; | 201 return; |
202 } | 202 } |
203 | 203 |
204 snapshotSize = metadata.length; | 204 snapshotSize = metadata.length; |
205 snapshotModificationTime = metadata.modificationTime; | 205 snapshotModificationTime = metadata.modificationTime; |
206 } | 206 } |
207 | 207 |
208 } // namespace WebCore | 208 } // namespace WebCore |
OLD | NEW |