Bug 646071 - Part 1: Reimplement nsTime on top of PRInt64; r=bsmedberg
authorJeff Muizelaar <jmuizelaar@mozilla.com>
Thu, 31 Mar 2011 20:14:13 -0400
changeset 64615 72fd2dac75055b39568e41633fc37eefe3e704e9
parent 64614 c22f220cb426eab80da51401dbacae7e4d9ffb54
child 64616 ff09586ff85af69259b4bff616261854efd72709
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs646071
milestone2.2a1pre
Bug 646071 - Part 1: Reimplement nsTime on top of PRInt64; r=bsmedberg
xpcom/ds/nsTime.h
--- a/xpcom/ds/nsTime.h
+++ b/xpcom/ds/nsTime.h
@@ -34,35 +34,34 @@
  * the terms of any one of the MPL, the GPL or the LGPL.
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsTime_h__
 #define nsTime_h__
 
 #include "prtime.h"
-#include "nsInt64.h"
 #include "nscore.h"
 
 /**
  * This class encapsulates full 64-bit time functionality and
  * provides simple arithmetic and conversion operations.
  */
 
 // If you ever decide that you need to add a non-inline method to this
 // class, be sure to change the class declaration to "class NS_BASE
 // nsTime".
 
-class nsTime : public nsInt64
+class nsTime
 {
 public:
     /**
      * Construct the current time.
      */
-    nsTime(void) : nsInt64(PR_Now()) {
+    nsTime(void) : mValue(PR_Now()) {
     }
 
     /**
      * Construct the time from a string.
      */
     nsTime(const char* dateStr, PRBool defaultToGMT) {
         PRInt64 theTime;
         PRStatus status = PR_ParseTimeString(dateStr, defaultToGMT, &theTime);
@@ -70,47 +69,29 @@ public:
             mValue = theTime;
         else
             mValue = LL_ZERO;
     }
 
     /**
      * Construct a time from a PRTime.
      */
-    nsTime(const PRTime aTime) : nsInt64(aTime) {
-    }
-
-    /**
-     * Construct a time from a 64-bit value.
-     */
-    nsTime(const nsInt64& aTime) : nsInt64(aTime) {
-    }
-
-    /**
-     * Construct a time from another time.
-     */
-    nsTime(const nsTime& aTime) : nsInt64(aTime.mValue) {
+    nsTime(const PRTime aTime) : mValue(aTime) {
     }
 
     // ~nsTime(void) -- XXX destructor unnecessary
 
     /**
-     * Assign one time to another.
-     */
-    const nsTime& operator =(const nsTime& aTime) {
-        mValue = aTime.mValue;
-        return *this;
-    }
-
-    /**
      * Convert a nsTime object to a PRTime
      */
     operator PRTime(void) const {
         return mValue;
     }
+
+    PRInt64 mValue;
 };
 
 /**
  * Determine if one time is strictly less than another
  */
 inline const PRBool
 operator <(const nsTime& aTime1, const nsTime& aTime2) {
     return aTime1.mValue < aTime2.mValue;