Bug 646071 - Part 1: Reimplement nsTime on top of PRInt64; r=bsmedberg

This commit is contained in:
Jeff Muizelaar 2011-03-31 20:14:13 -04:00
parent 312ef020c8
commit 649e74e3f6

View File

@ -39,7 +39,6 @@
#define nsTime_h__
#include "prtime.h"
#include "nsInt64.h"
#include "nscore.h"
/**
@ -51,13 +50,13 @@
// 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()) {
}
/**
@ -75,37 +74,19 @@ public:
/**
* 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;
};
/**