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

Unified Diff: base/time.h

Issue 16093026: Provide nanoseconds precision for base::PlatformFileInfo on POSIX (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: st_?time_nsec doe not exist in the bots' NDK, use FromTimeT for Android Created 7 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/file_util_posix.cc ('k') | base/time.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/time.h
diff --git a/base/time.h b/base/time.h
index 9c20b548b474031e190c806c6aef2a5ad27a3c1c..e722122d2113d7adfcf054ba072825cf5f0cb01e 100644
--- a/base/time.h
+++ b/base/time.h
@@ -286,6 +286,14 @@ class BASE_EXPORT Time {
static Time FromDoubleT(double dt);
double ToDoubleT() const;
+#if defined(OS_POSIX)
+ // Converts the timespec structure to time. MacOS X 10.8.3 (and tentatively,
+ // earlier versions) will have the |ts|'s tv_nsec component zeroed out,
+ // having a 1 second resolution, which agrees with
+ // https://developer.apple.com/legacy/library/#technotes/tn/tn1150.html#HFSPlusDates.
+ static Time FromTimeSpec(const timespec& ts);
+#endif
+
// Converts to/from the Javascript convention for times, a number of
// milliseconds since the epoch:
// https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Date/getTime.
« no previous file with comments | « base/file_util_posix.cc ('k') | base/time.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698