mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 646071 - Part 1: Reimplement nsTime on top of PRInt64; r=bsmedberg
This commit is contained in:
parent
312ef020c8
commit
649e74e3f6
@ -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