diff options
Diffstat (limited to 'Source/WebCore/fileapi/File.cpp')
-rw-r--r-- | Source/WebCore/fileapi/File.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/Source/WebCore/fileapi/File.cpp b/Source/WebCore/fileapi/File.cpp index 692bde1ac..54e5a9001 100644 --- a/Source/WebCore/fileapi/File.cpp +++ b/Source/WebCore/fileapi/File.cpp @@ -20,7 +20,7 @@ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "config.h" @@ -30,6 +30,7 @@ #include "FileSystem.h" #include "MIMETypeRegistry.h" #include <wtf/CurrentTime.h> +#include <wtf/DateMath.h> #include <wtf/text/WTFString.h> namespace WebCore { @@ -52,6 +53,7 @@ static String getContentTypeFromFileName(const String& name, File::ContentTypeLo static PassOwnPtr<BlobData> createBlobDataForFileWithType(const String& path, const String& contentType) { OwnPtr<BlobData> blobData = BlobData::create(); + ASSERT(Blob::isNormalizedContentType(contentType)); blobData->setContentType(contentType); blobData->appendFile(path); return blobData.release(); @@ -116,7 +118,7 @@ File::File(const String& path, const KURL& url, const String& type) m_name = pathGetFileName(path); // FIXME: File object serialization/deserialization does not include // newer file object data members: m_name and m_relativePath. - // See SerializedScriptValue.cpp for js and v8. + // See SerializedScriptValue.cpp } File::File(const String& path, const String& name, ContentTypeLookupPolicy policy) @@ -152,16 +154,15 @@ File::File(const KURL& fileSystemURL, const FileMetadata& metadata) double File::lastModifiedDate() const { #if ENABLE(FILE_SYSTEM) - if (hasValidSnapshotMetadata()) - return m_snapshotModificationTime * 1000.0; + if (hasValidSnapshotMetadata() && isValidFileTime(m_snapshotModificationTime)) + return m_snapshotModificationTime * msPerSecond; #endif time_t modificationTime; - if (!getFileModificationTime(m_path, modificationTime)) - return invalidFileTime(); + if (getFileModificationTime(m_path, modificationTime) && isValidFileTime(modificationTime)) + return modificationTime * msPerSecond; - // Needs to return epoch time in milliseconds for Date. - return modificationTime * 1000.0; + return currentTime() * msPerSecond; } unsigned long long File::size() const |