bug 408729 - annotate crash report with StartupTime. r=mento
authorted.mielczarek@gmail.com
Tue, 18 Dec 2007 08:07:26 -0800
changeset 9410 c7545b8f1bc59e3113110a80173213d2bd6331a3
parent 9409 4730cae26d3e265cecdc571cc8306a76e172c9b6
child 9411 854eece751ad21463fad2629f93fdc96857de29e
push idunknown
push userunknown
push dateunknown
reviewersmento
bugs408729
milestone1.9b3pre
bug 408729 - annotate crash report with StartupTime. r=mento
toolkit/crashreporter/nsExceptionHandler.cpp
--- a/toolkit/crashreporter/nsExceptionHandler.cpp
+++ b/toolkit/crashreporter/nsExceptionHandler.cpp
@@ -412,16 +412,22 @@ nsresult SetExceptionHandler(nsILocalFil
   if (!gExceptionHandler)
     return NS_ERROR_OUT_OF_MEMORY;
 
   // store server URL with the API data
   if (aServerURL)
     AnnotateCrashReport(NS_LITERAL_CSTRING("ServerURL"),
                         nsDependentCString(aServerURL));
 
+  // store application start time
+  nsCAutoString timeString;
+  timeString.AppendInt(time(NULL));
+  AnnotateCrashReport(NS_LITERAL_CSTRING("StartupTime"),
+                      timeString);
+
 #if defined(XP_MACOSX)
   // On OS X, many testers like to see the OS crash reporting dialog
   // since it offers immediate stack traces.  We allow them to set
   // a default to pass exceptions to the OS handler.
   showOSCrashReporter = PassToOSCrashReporter();
 #endif
 
   return NS_OK;