Backing out 407018, trace_malloc_allocs on bm-xserve11 jumped from 460K to 570K.

This commit is contained in:
dolske@mozilla.com 2007-12-05 22:51:24 -08:00
parent 59d39af7fc
commit 4d2443b205
2 changed files with 11 additions and 16 deletions

View File

@ -479,18 +479,16 @@ nsNavHistoryExpire::FindVisits(PRTime aExpireThreshold, PRUint32 aNumToExpire,
nsresult rv = aConnection->CreateStatement(sqlMinAge, getter_AddRefs(selectMinStatement));
NS_ENSURE_SUCCESS(rv, rv);
PRInt64 minDaysAgo = mHistory->mExpireDaysMin * 86400 * PR_USEC_PER_SEC;
PRTime minThreshold = PR_Now() - minDaysAgo;
rv = selectMinStatement->BindInt64Parameter(0, minThreshold);
rv = selectStatement->BindInt64Parameter(0, aExpireThreshold);
NS_ENSURE_SUCCESS(rv, rv);
rv = selectMinStatement->BindInt64Parameter(1, aNumToExpire);
rv = selectStatement->BindInt64Parameter(1, aNumToExpire);
NS_ENSURE_SUCCESS(rv, rv);
rv = selectMinStatement->BindInt32Parameter(2, mHistory->mExpireSites);
rv = selectStatement->BindInt32Parameter(2, mHistory->mExpireSites);
NS_ENSURE_SUCCESS(rv, rv);
hasMore = PR_FALSE;
while (NS_SUCCEEDED(selectMinStatement->ExecuteStep(&hasMore)) && hasMore) {
nsNavHistoryExpireRecord record(selectMinStatement);
while (NS_SUCCEEDED(selectStatement->ExecuteStep(&hasMore)) && hasMore) {
nsNavHistoryExpireRecord record(selectStatement);
aRecords.AppendElement(record);
}
}

View File

@ -533,12 +533,11 @@ confirmation:
- query for the visit, confirm it's there
*/
function startExpireDaysOnly() {
dump("startExpireDaysOnly()\n");
// setup
histsvc.removeAllPages();
observer.expiredURI = null;
dump("startExpireDaysOnly()\n");
// add expirable visit
histsvc.addVisit(testURI, (Date.now() - (86400 * 2 * 1000)) * 1000, 0, histsvc.TRANSITION_TYPED, false, 0);
annosvc.setPageAnnotation(testURI, testAnnoName, testAnnoVal, 0, annosvc.EXPIRE_WITH_HISTORY);
@ -549,9 +548,7 @@ function startExpireDaysOnly() {
// set visit cap to 2
prefs.setIntPref("browser.history_expire_sites", 2);
// set date minimum to 2
prefs.setIntPref("browser.history_expire_days_min", 2);
// set date maximum to 3
prefs.setIntPref("browser.history_expire_days", 3);
prefs.setIntPref("browser.history_expire_days", 2);
// trigger expiration
ghist.addURI(triggerURI, false, true, null);
@ -563,8 +560,8 @@ function startExpireDaysOnly() {
function checkExpireDaysOnly() {
try {
// test expired record
do_check_eq(observer.expiredURI, null);
do_check_eq(annosvc.getPageAnnotationNames(testURI, {}).length, 1);
do_check_eq(observer.expiredURI, testURI.spec);
do_check_eq(annosvc.getPageAnnotationNames(testURI, {}).length, 0);
// test unexpired record
do_check_neq(histsvc.getPageTitle(uri("http://unexpirable.com")), null);
} catch(ex) {}
@ -594,10 +591,10 @@ confirmation:
- query for the visit, confirm it's not there
*/
function startExpireBoth() {
dump("starting expiration test 3: both criteria met\n");
// setup
histsvc.removeAllPages();
observer.expiredURI = null;
dump("starting expiration test 3: both criteria met\n");
// add visits
// 2 days old, in microseconds
@ -612,7 +609,7 @@ function startExpireBoth() {
// set date max to 3
prefs.setIntPref("browser.history_expire_days", 3);
// set date minimum to 1
prefs.setIntPref("browser.history_expire_days_min", 1);
prefs.setIntPref("browser.history_expire_days", 1);
// trigger expiration
ghist.addURI(triggerURI, false, true, null);