Closed Bug 476297 Opened 16 years ago Closed 16 years ago

Switch NavHistory idle listener to idle-daily

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9.2a1

People

(Reporter: Mardak, Assigned: Mardak)

References

Details

(Keywords: fixed1.9.1)

Attachments

(1 file, 1 obsolete file)

This is part 1 of 3 to address bug 458801. We can use the new notification from bug 476254 to do some work once a day when the user isn't there.
Blocks: 476298
Attached patch v1 (obsolete) (deleted) — Splinter Review
Switch over to idle-daily. Reordered the behavior in the idle handler... (Expiring pages first should make fewer things to work on for recalc, yeah?) Delete delete delete!
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #359942 - Flags: review?(dietrich)
Would we want to up the number of pages to expire as we'll only expire once a day (and when the user quits)?
I think for expiration we want to change our algorithm entirely.
Comment on attachment 359942 [details] [diff] [review] v1 currently, expiration can happen N times daily, when the user is idle. this switches to a single expiration run per day, right? i don't think this is feasible without some mechanism to ensure expiration doesn't fall too far behind.
Right. This makes it expire once a day, so that's why I suggested perhaps bumping up the number of pages to expire. But as Shawn pointed out, we'll probably switch to a different/async/continuous method of expiration instead of the current idle timer or this once-a-day-idle event.
Attached patch v2 (deleted) — Splinter Review
Just switch frecency recalculations to idle-daily and leave expiration for now.
Attachment #359942 - Attachment is obsolete: true
Attachment #360944 - Flags: review?(dietrich)
Attachment #359942 - Flags: review?(dietrich)
Comment on attachment 360944 [details] [diff] [review] v2 >@@ -5380,6 +5374,10 @@ > if (oldDaysMin != mExpireDaysMin || oldDaysMax != mExpireDaysMax || > oldVisits != mExpireSites) > mExpire.OnExpirationChanged(); >+ } else if (nsCRT::strcmp(aTopic, gIdleDaily) == 0) { >+ // Recalculate some frecency values (zero time means don't recalculate) >+ if (mFrecencyUpdateIdleTime) >+ (void)RecalculateFrecencies(mNumCalculateFrecencyOnIdle, PR_TRUE); > } else if (nsCRT::strcmp(aTopic, NS_PRIVATE_BROWSING_SWITCH_TOPIC) == 0) { > if (NS_LITERAL_STRING(NS_PRIVATE_BROWSING_ENTER).Equals(aData)) { > mInPrivateBrowsing = PR_TRUE; hm, mFrecencyUpdateIdleTime is now just basically acting the bool for whether or not to recalculate frecency at all, right? can you update the pref comments in firefox js, as well as the handling and name of mFrecencyUpdateIdleTime? r=me w/ those changes.
Attachment #360944 - Flags: review?(dietrich) → review+
(In reply to comment #7) > hm, mFrecencyUpdateIdleTime is now just basically acting the bool for whether > or not to recalculate frecency at all, right? Yeah. Is it okay if I just leave the comment there as I'll be removing the pref in the next part (bug 476298) of these patches: >Bug 476298 - Switch RecalculateFrecencies to just fix invalid frecencies >Bug 476300 - Calculate all page frecencies when upgrading/migrating >+++ b/browser/app/profile/firefox.js >-// Perform frecency recalculation after this amount of idle, repeating. >-// A value of zero disables updating of frecency on idle. >-// Default is 1 minute (60000ms). >-pref("places.frecency.updateIdleTime", 60000); >+++ b/toolkit/components/places/src/nsNavHistory.cpp >@@ -5318,9 +5300,8 @@ >- // Recalculate some frecency values (zero time means don't recalculate) >- if (mFrecencyUpdateIdleTime) >- (void)RecalculateFrecencies(mNumCalculateFrecencyOnIdle, PR_TRUE); >+ // Update frecency values >+ (void)FixInvalidFrecencies();
ah ok, sure.
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.2a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: