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

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 m_hasLastModifiedDate in release builds. 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 if (isValidFileTime(m_snapshotModificationTime))
sof 2013/11/17 17:16:34 This check looks redundant also, just return "m_sn
pwnall-personal 2013/11/17 17:50:47 Done. Thank you!
166 return m_snapshotModificationTime * msPerSecond;
167 return m_snapshotModificationTime;
168 }
166 169
167 time_t modificationTime; 170 time_t modificationTime;
168 if (getFileModificationTime(m_path, modificationTime) && isValidFileTime(mod ificationTime)) 171 if (getFileModificationTime(m_path, modificationTime) && isValidFileTime(mod ificationTime))
169 return modificationTime * msPerSecond; 172 return modificationTime * msPerSecond;
170 173
171 return currentTime() * msPerSecond; 174 return currentTime() * msPerSecond;
172 } 175 }
173 176
174 unsigned long long File::size() const 177 unsigned long long File::size() const
175 { 178 {
(...skipping 23 matching lines...) Expand all
199 snapshotSize = 0; 202 snapshotSize = 0;
200 snapshotModificationTime = invalidFileTime(); 203 snapshotModificationTime = invalidFileTime();
201 return; 204 return;
202 } 205 }
203 206
204 snapshotSize = metadata.length; 207 snapshotSize = metadata.length;
205 snapshotModificationTime = metadata.modificationTime; 208 snapshotModificationTime = metadata.modificationTime;
206 } 209 }
207 210
208 } // namespace WebCore 211 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698