Title: [200061] trunk/Source/WebCore
Revision
200061
Author
beid...@apple.com
Date
2016-04-25 17:12:22 -0700 (Mon, 25 Apr 2016)

Log Message

Fix a flaky test after r200032

* fileapi/File.cpp:
(WebCore::File::lastModified): This used to return a date object which did a WTF::timeClip on the double,
  but now that we're returning a raw double we need to WTF::timeClip it ourselves.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (200060 => 200061)


--- trunk/Source/WebCore/ChangeLog	2016-04-25 23:50:25 UTC (rev 200060)
+++ trunk/Source/WebCore/ChangeLog	2016-04-26 00:12:22 UTC (rev 200061)
@@ -1,3 +1,11 @@
+2016-04-25  Brady Eidson  <beid...@apple.com>
+
+        Fix a flaky test after r200032
+
+        * fileapi/File.cpp:
+        (WebCore::File::lastModified): This used to return a date object which did a WTF::timeClip on the double,
+          but now that we're returning a raw double we need to WTF::timeClip it ourselves.
+
 2016-04-25  Chris Dumez  <cdu...@apple.com>
 
         [Web IDL] Specify default values for optional parameters of type 'float' / 'unrestricted float'

Modified: trunk/Source/WebCore/fileapi/File.cpp (200060 => 200061)


--- trunk/Source/WebCore/fileapi/File.cpp	2016-04-25 23:50:25 UTC (rev 200060)
+++ trunk/Source/WebCore/fileapi/File.cpp	2016-04-26 00:12:22 UTC (rev 200061)
@@ -76,14 +76,18 @@
     if (m_overrideLastModifiedDate)
         return m_overrideLastModifiedDate.value();
 
+    double result;
+
     // FIXME: This does sync-i/o on the main thread and also recalculates every time the method is called.
     // The i/o should be performed on a background thread,
     // and the result should be cached along with an asynchronous monitor for changes to the file.
     time_t modificationTime;
     if (getFileModificationTime(m_path, modificationTime) && isValidFileTime(modificationTime))
-        return modificationTime * msPerSecond;
+        result = modificationTime * msPerSecond;
+    else
+        result = currentTime() * msPerSecond;
 
-    return currentTime() * msPerSecond;
+    return WTF::timeClip(result);
 }
 
 void File::computeNameAndContentType(const String& path, const String& nameOverride, String& effectiveName, String& effectiveContentType)
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to