From 2c6105bd69ade287fdd2b007db05d33232f8b732 Mon Sep 17 00:00:00 2001 From: "dietrich%mozilla.com" Date: Tue, 20 Nov 2007 23:45:34 +0000 Subject: [PATCH] Bug 403040 Places killed all my history >2 days ago (for mak77@supereva.it, r=dietrich) git-svn-id: svn://10.0.0.236/trunk@239757 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/toolkit/components/places/src/nsNavHistory.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mozilla/toolkit/components/places/src/nsNavHistory.cpp b/mozilla/toolkit/components/places/src/nsNavHistory.cpp index d176c0bba7a..9baf9955e83 100644 --- a/mozilla/toolkit/components/places/src/nsNavHistory.cpp +++ b/mozilla/toolkit/components/places/src/nsNavHistory.cpp @@ -167,6 +167,9 @@ // Amount of items to expire at idle time. #define MAX_EXPIRE_RECORDS_ON_IDLE 200 +// Limit the number of items in the history for performance reasons +#define EXPIRATION_CAP_VISITS 20000 + NS_IMPL_ADDREF(nsNavHistory) NS_IMPL_RELEASE(nsNavHistory) @@ -1388,7 +1391,10 @@ nsNavHistory::LoadPrefs() return NS_OK; mPrefBranch->GetIntPref(PREF_BROWSER_HISTORY_EXPIRE_DAYS, &mExpireDays); - mPrefBranch->GetIntPref(PREF_BROWSER_HISTORY_EXPIRE_VISITS, &mExpireVisits); + if (NS_FAILED(mPrefBranch->GetIntPref(PREF_BROWSER_HISTORY_EXPIRE_VISITS, + &mExpireVisits))) + mExpireVisits = EXPIRATION_CAP_VISITS; + PRBool oldCompleteOnlyTyped = mAutoCompleteOnlyTyped; mPrefBranch->GetBoolPref(PREF_AUTOCOMPLETE_ONLY_TYPED, &mAutoCompleteOnlyTyped);