about:startup - PR_IntervalNow is kinda dumb. It makes no special attempt to be monotonic like the docs say, and additionally there's no way to equate it back to a real timestamp (which the docs do imply). Using PR_Now instead.

This commit is contained in:
Daniel Brooks 2010-07-31 00:53:58 -05:00
parent 2d1ef93cea
commit ec86a6d7ae
5 changed files with 7 additions and 7 deletions

View File

@ -4,4 +4,4 @@ var Ci = Components.interfaces;
var runtime = Cc["@mozilla.org/xre/runtime;1"]
.getService(Ci.nsIXULRuntime);
var started = document.getElementById("started");
started.textContent = runtime.startupTimestamp
started.textContent = new Date(runtime.startupTimestamp/1000) +" ("+ runtime.startupTimestamp +")";

View File

@ -73,7 +73,7 @@ ScopedAppData::ScopedAppData(const nsXREAppData* aAppData)
this->size = aAppData->size;
if (aAppData->size > offsetof(nsXREAppData, startupTimestamp)) {
this->startupTimestamp = PR_IntervalNow();
this->startupTimestamp = PR_Now();
}
SetAllocatedString(this->vendor, aAppData->vendor);

View File

@ -806,13 +806,13 @@ nsXULAppInfo::InvalidateCachesOnRestart()
}
/* readonly attribute unsigned long launchTimestamp; */
NS_IMETHODIMP nsXULAppInfo::GetLaunchTimestamp(PRUint32 *aTimestamp)
NS_IMETHODIMP nsXULAppInfo::GetLaunchTimestamp(PRUint64 *aTimestamp)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute unsigned long startupTimestamp; */
NS_IMETHODIMP nsXULAppInfo::GetStartupTimestamp(PRUint32 *aTimestamp)
NS_IMETHODIMP nsXULAppInfo::GetStartupTimestamp(PRUint64 *aTimestamp)
{
*aTimestamp = gAppData->startupTimestamp;
return NS_OK;

View File

@ -155,7 +155,7 @@ struct nsXREAppData
/**
*
*/
PRIntervalTime startupTimestamp;
PRTime startupTimestamp;
};
/**

View File

@ -108,6 +108,6 @@ interface nsIXULRuntime : nsISupports
*/
void invalidateCachesOnRestart();
readonly attribute unsigned long launchTimestamp;
readonly attribute unsigned long startupTimestamp;
readonly attribute unsigned long long launchTimestamp;
readonly attribute unsigned long long startupTimestamp;
};