From 131092f5f1809257ffbe4c008eebd8a7a81b8385 Mon Sep 17 00:00:00 2001 From: "bryner%brianryner.com" Date: Tue, 13 Jun 2006 22:46:07 +0000 Subject: [PATCH] Don't exit early from ProfileStartup just because the event count pref doesn't exist (bug 341438) r=marria --- extensions/metrics/src/nsMetricsService.cpp | 12 ++++-------- extensions/metrics/src/nsMetricsService.h | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/extensions/metrics/src/nsMetricsService.cpp b/extensions/metrics/src/nsMetricsService.cpp index b1dc18fd66f..ec55abec8c7 100644 --- a/extensions/metrics/src/nsMetricsService.cpp +++ b/extensions/metrics/src/nsMetricsService.cpp @@ -856,7 +856,7 @@ nsMetricsService::NotifyNewLog(const nsAString &key, return PL_DHASH_NEXT; } -nsresult +void nsMetricsService::EnableCollectors() { // Start and stop collectors based on the current config. @@ -899,8 +899,6 @@ nsMetricsService::EnableCollectors() // Finally, notify all collectors that we've restarted the log. mCollectorMap.EnumerateRead(NotifyNewLog, nsnull); - - return NS_OK; } // Copied from nsStreamUtils.cpp: @@ -1014,8 +1012,7 @@ nsMetricsService::ProfileStartup() nsCOMPtr prefs = do_GetService(NS_PREFSERVICE_CONTRACTID); NS_ENSURE_STATE(prefs); - nsresult rv = prefs->GetIntPref("metrics.event-count", &mEventCount); - NS_ENSURE_SUCCESS(rv, rv); + prefs->GetIntPref("metrics.event-count", &mEventCount); // Update the session id pref for the new session static const char kSessionIDPref[] = "metrics.last-session-id"; @@ -1023,12 +1020,11 @@ nsMetricsService::ProfileStartup() prefs->GetIntPref(kSessionIDPref, &sessionID); mSessionID.Cut(0, PR_UINT32_MAX); AppendInt(mSessionID, ++sessionID); - rv = FlushIntPref(kSessionIDPref, sessionID); + nsresult rv = FlushIntPref(kSessionIDPref, sessionID); NS_ENSURE_SUCCESS(rv, rv); // Start up the collectors - rv = EnableCollectors(); - NS_ENSURE_SUCCESS(rv, rv); + EnableCollectors(); // If we didn't load a config file, we should upload as soon as possible. InitUploadTimer(!loaded); diff --git a/extensions/metrics/src/nsMetricsService.h b/extensions/metrics/src/nsMetricsService.h index 18bb72ddf39..4b64ac54a12 100644 --- a/extensions/metrics/src/nsMetricsService.h +++ b/extensions/metrics/src/nsMetricsService.h @@ -153,7 +153,7 @@ private: nsresult ProfileStartup(); // Starts and stops collectors based on the current configuration - nsresult EnableCollectors(); + void EnableCollectors(); // Creates a new root element to hold event nodes nsresult CreateRoot();