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
Родитель b7b8162d74
Коммит 5abbf16f2e
5 изменённых файлов: 7 добавлений и 7 удалений

Просмотреть файл

@ -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 +")";

Просмотреть файл

@ -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);

Просмотреть файл

@ -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;

Просмотреть файл

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

Просмотреть файл

@ -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;
};