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.
authorDaniel Brooks <db48x@db48x.net>
Sat, 31 Jul 2010 00:53:58 -0500
changeset 58817 2022273e1553b0f0b79702b4c15a219bb2ade25d
parent 58816 dda9446e1e7dfb7c298dde825bc3519751d04b5b
child 58818 f05783938aa6c8a4524b5d1c55d54a3f073ef87c
push idunknown
push userunknown
push dateunknown
milestone2.0b3pre
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.
browser/base/content/aboutStartup.js
toolkit/xre/nsAppData.cpp
toolkit/xre/nsAppRunner.cpp
xpcom/build/nsXULAppAPI.h
xpcom/system/nsIXULRuntime.idl
--- a/browser/base/content/aboutStartup.js
+++ b/browser/base/content/aboutStartup.js
@@ -1,7 +1,7 @@
 var Cc = Components.classes;
 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 +")";
--- a/toolkit/xre/nsAppData.cpp
+++ b/toolkit/xre/nsAppData.cpp
@@ -68,17 +68,17 @@ SetAllocatedString(const char *&str, con
 
 ScopedAppData::ScopedAppData(const nsXREAppData* aAppData)
 {
   Zero();
 
   this->size = aAppData->size;
 
   if (aAppData->size > offsetof(nsXREAppData, startupTimestamp)) {
-    this->startupTimestamp = PR_IntervalNow();
+    this->startupTimestamp = PR_Now();
   }
 
   SetAllocatedString(this->vendor, aAppData->vendor);
   SetAllocatedString(this->name, aAppData->name);
   SetAllocatedString(this->version, aAppData->version);
   SetAllocatedString(this->buildID, aAppData->buildID);
   SetAllocatedString(this->ID, aAppData->ID);
   SetAllocatedString(this->copyright, aAppData->copyright);
--- a/toolkit/xre/nsAppRunner.cpp
+++ b/toolkit/xre/nsAppRunner.cpp
@@ -801,23 +801,23 @@ nsXULAppInfo::InvalidateCachesOnRestart(
     
     if (NS_FAILED(rv))
       return rv;
   }
   return NS_OK;
 }
 
 /* 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;
 }
 
 
 
 #ifdef XP_WIN
--- a/xpcom/build/nsXULAppAPI.h
+++ b/xpcom/build/nsXULAppAPI.h
@@ -150,17 +150,17 @@ struct nsXREAppData
    *
    *   UAppData = $HOME/$profile
    */
   const char *profile;
 
   /**
    * 
    */
-  PRIntervalTime startupTimestamp;
+  PRTime startupTimestamp;
 };
 
 /**
  * Indicates whether or not the profile migrator service may be
  * invoked at startup when creating a profile.
  */
 #define NS_XRE_ENABLE_PROFILE_MIGRATOR (1 << 1)
 
--- a/xpcom/system/nsIXULRuntime.idl
+++ b/xpcom/system/nsIXULRuntime.idl
@@ -103,11 +103,11 @@ interface nsIXULRuntime : nsISupports
 
   /**
    * Signal the apprunner to invalidate caches on the next restart.
    * This will cause components to be autoregistered and all
    * fastload data to be re-created.
    */
   void invalidateCachesOnRestart();
 
-  readonly attribute unsigned long launchTimestamp;
-  readonly attribute unsigned long startupTimestamp;
+  readonly attribute unsigned long long launchTimestamp;
+  readonly attribute unsigned long long startupTimestamp;
 };