From 1188bd8ea16c3f6112e51a51873e9a9d97b528d8 Mon Sep 17 00:00:00 2001 From: "benjamin%smedbergs.us" Date: Tue, 18 Jul 2006 16:15:49 +0000 Subject: [PATCH] Bug 207022 r=annie.sullivan Redirects sometimes appear in the wrong order (places is disabled by default) Original committer: brettw%gmail.com Original revision: 1.46 Original date: 2005/12/29 17:59:04 git-svn-id: svn://10.0.0.236/trunk@202618 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/toolkit/components/places/src/nsNavHistory.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/mozilla/toolkit/components/places/src/nsNavHistory.cpp b/mozilla/toolkit/components/places/src/nsNavHistory.cpp index 1b1ec081800..458e39d1a54 100644 --- a/mozilla/toolkit/components/places/src/nsNavHistory.cpp +++ b/mozilla/toolkit/components/places/src/nsNavHistory.cpp @@ -1919,9 +1919,12 @@ NS_IMETHODIMP nsNavHistory::AddURI(nsIURI *aURI, PRBool aRedirect, PRBool aToplevel, nsIURI *aReferrer) { - // add to main DB - PRInt64 pageid = 0; - PRTime now = GetNow(); + // Note that here we should NOT use the GetNow function. That function caches + // the value of "now" until next time the event loop runs. This gives better + // performance, but here we may get many notifications without running the + // event loop. We must preserve these events' ordering. This most commonly + // happens on redirects. + PRTime now = PR_Now(); // check for transition types PRUint32 transitionType = 0; @@ -1956,6 +1959,7 @@ nsNavHistory::AddURI(nsIURI *aURI, PRBool aRedirect, } } + PRInt64 pageid = 0; nsresult rv = InternalAdd(aURI, aReferrer, 0, transitionType, nsnull, now, aRedirect, aToplevel, &pageid); NS_ENSURE_SUCCESS(rv, rv);