From d62a1a5e35892d318215a6773f332a8b09031ce9 Mon Sep 17 00:00:00 2001 From: "brettw%gmail.com" Date: Wed, 22 Mar 2006 22:22:50 +0000 Subject: [PATCH] Bug 327818 r=bryner Make 0 days of history disable history. git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@192812 18797224-902f-48f8-a5cc-f745e15eee43 --- .../components/places/src/nsNavHistory.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/mozilla/browser/components/places/src/nsNavHistory.cpp b/mozilla/browser/components/places/src/nsNavHistory.cpp index 4eab94e9390..fd6180c5496 100644 --- a/mozilla/browser/components/places/src/nsNavHistory.cpp +++ b/mozilla/browser/components/places/src/nsNavHistory.cpp @@ -1439,6 +1439,10 @@ nsNavHistory::SetPageUserTitle(nsIURI* aURI, const nsAString& aUserTitle) NS_IMETHODIMP nsNavHistory::MarkPageAsFollowedBookmark(nsIURI* aURI) { + // if history expiration is set to 0 days it is disabled, so don't add + if (mExpireDays == 0) + return NS_OK; + nsCAutoString uriString; aURI->GetSpec(uriString); @@ -2459,6 +2463,10 @@ nsNavHistory::HidePage(nsIURI *aURI) NS_IMETHODIMP nsNavHistory::MarkPageAsTyped(nsIURI *aURI) { + // if history expiration is set to 0 days it is disabled, so don't add + if (mExpireDays == 0) + return NS_OK; + nsCAutoString uriString; aURI->GetSpec(uriString); @@ -2485,6 +2493,10 @@ NS_IMETHODIMP nsNavHistory::AddURI(nsIURI *aURI, PRBool aRedirect, PRBool aToplevel, nsIURI *aReferrer) { + // if history expiration is set to 0 days it is disabled, so don't add + if (mExpireDays == 0) + return NS_OK; + mozStorageTransaction transaction(mDBConn, PR_FALSE); PRInt64 redirectBookmark = 0; @@ -2628,6 +2640,12 @@ nsNavHistory::AddVisitChain(nsIURI* aURI, PRBool aToplevel, PRBool aIsRedirect, NS_IMETHODIMP nsNavHistory::IsVisited(nsIURI *aURI, PRBool *_retval) { + // if history expiration is set to 0 days it is disabled, we can optimize + if (mExpireDays == 0) { + *_retval = PR_FALSE; + return NS_OK; + } + nsCAutoString utf8URISpec; nsresult rv = aURI->GetSpec(utf8URISpec); NS_ENSURE_SUCCESS(rv, rv);