about:startup - record timestamp early on in the XRE setup

This commit is contained in:
Daniel Brooks 2010-07-29 19:51:32 -05:00
Родитель eec2b0ffce
Коммит 28aeba0141
5 изменённых файлов: 27 добавлений и 0 удалений

4
toolkit/xre/nsAppData.cpp Normal file → Executable file
Просмотреть файл

@ -72,6 +72,10 @@ ScopedAppData::ScopedAppData(const nsXREAppData* aAppData)
this->size = aAppData->size;
if (aAppData->size > offsetof(nsXREAppData, startupTimestamp)) {
this->startupTimestamp = PR_IntervalNow();
}
SetAllocatedString(this->vendor, aAppData->vendor);
SetAllocatedString(this->name, aAppData->name);
SetAllocatedString(this->version, aAppData->version);

15
toolkit/xre/nsAppRunner.cpp Normal file → Executable file
Просмотреть файл

@ -805,6 +805,21 @@ nsXULAppInfo::InvalidateCachesOnRestart()
return NS_OK;
}
/* readonly attribute unsigned long launchTimestamp; */
NS_IMETHODIMP nsXULAppInfo::GetLaunchTimestamp(PRUint32 *aTimestamp)
{
return NS_ERROR_NOT_IMPLEMENTED;
}
/* readonly attribute unsigned long startupTimestamp; */
NS_IMETHODIMP nsXULAppInfo::GetStartupTimestamp(PRUint32 *aTimestamp)
{
*aTimestamp = gAppData->startupTimestamp;
return NS_OK;
}
#ifdef XP_WIN
// Matches the enum in WinNT.h for the Vista SDK but renamed so that we can
// safely build with the Vista SDK and without it.

5
xpcom/build/nsXULAppAPI.h Normal file → Executable file
Просмотреть файл

@ -151,6 +151,11 @@ struct nsXREAppData
* UAppData = $HOME/$profile
*/
const char *profile;
/**
*
*/
PRIntervalTime startupTimestamp;
};
/**

0
xpcom/system/nsIXULAppInfo.idl Normal file → Executable file
Просмотреть файл

3
xpcom/system/nsIXULRuntime.idl Normal file → Executable file
Просмотреть файл

@ -107,4 +107,7 @@ interface nsIXULRuntime : nsISupports
* fastload data to be re-created.
*/
void invalidateCachesOnRestart();
readonly attribute unsigned long launchTimestamp;
readonly attribute unsigned long startupTimestamp;
};