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

Side by Side Diff: Source/core/fileapi/File.cpp

Issue 74213009: File constructor understands lastModified. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed unnecessary branches for NaN. Created 7 years, 1 month 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698