mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 646071 - Part 1: Reimplement nsTime on top of PRInt64; r=bsmedberg
This commit is contained in:
parent
4b4c0598a6
commit
54d6f693a6
@ -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;
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user