Bug 1083530. Part 1 Create mozilla::TimeStamp constructor with system time param. r=roc
authorMason Chang <mchang@mozilla.com>
Wed, 29 Oct 2014 13:36:51 -0700
changeset 213081 907d4f91d07c9f35ad23b790b1270da244421681
parent 213080 1644638894d3659984fcf0f01ad32072ebc7b3bb
child 213082 a9748c48d9bd4d38695616440800ecf2547588f5
push id51143
push usercbook@mozilla.com
push dateThu, 30 Oct 2014 14:14:04 +0000
treeherdermozilla-inbound@e80345c5bf6f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1083530
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1083530. Part 1 Create mozilla::TimeStamp constructor with system time param. r=roc
xpcom/ds/TimeStamp.h
--- a/xpcom/ds/TimeStamp.h
+++ b/xpcom/ds/TimeStamp.h
@@ -382,16 +382,24 @@ class TimeStamp
 {
 public:
   /**
    * Initialize to the "null" moment
    */
   MOZ_CONSTEXPR TimeStamp() : mValue(0) {}
   // Default copy-constructor and assignment are OK
 
+#ifdef MOZ_WIDGET_GONK
+  TimeStamp(int64_t aAndroidTime) : mValue(aAndroidTime)
+  {
+    static_assert(sizeof(aAndroidTime) == sizeof(TimeStampValue),
+                  "Android timestamp should be same units as TimeStampValue");
+  }
+#endif
+
   /**
    * Return true if this is the "null" moment
    */
   bool IsNull() const { return mValue == 0; }
 
   /**
    * Return a timestamp reflecting the current elapsed system time. This
    * is monotonically increasing (i.e., does not decrease) over the