Closed Bug 1703083 Opened 3 years ago Closed 3 years ago

Use the lazy pref getter workaround for SHOW_OTHER_BOOKMARKS.

Categories

(Core :: XPCOM, defect, P1)

defect

Tracking

()

RESOLVED FIXED
89 Branch
Tracking Status
firefox89 --- fixed

People

(Reporter: mccr8, Assigned: mccr8)

References

Details

Attachments

(2 files, 1 obsolete file)

If we're going to need this work around, I think it makes sense to make it easier to use. I've written a new XPCOMUtils method defineWeakLazyPreferenceGetter that takes an extra argument. It creates a weak reference to this object, and only calls the callback if the weak reference referent is still around. It also passes the object into the callback. I suppose technically that isn't necessary, but not doing it would more bizarre looking.

I've also fixed the SHOW_OTHER_BOOKMARKS getter which looks like it is the only lazy pref callback actually being run in browser_toolbar_other_bookmarks.js, so hopefully this will tamp down bug 1652531 again.

Depends on: 1699614

This adds a new helper method that deals with the weak ref stuff itself,
and updates the other place I fixed to use it.

aWeakObject is a later argument so that the ES lint setter
checking stuff still works.

This lazy pref getter callback fires a number of times while running
browser_toolbar_other_bookmarks.js, which is experiencing a number
of intermittent failures due to the XPCWJS weak reference CC issue
(bug 1652531) so hopefully this will fix that.

Attachment #9213647 - Attachment description: Bug 1703083, part 2 - Use the lazy pref getter workaround for SHOW_OTHER_BOOKMARKS. → Bug 1703083 - Use the lazy pref getter workaround for SHOW_OTHER_BOOKMARKS.
Attachment #9213646 - Attachment is obsolete: true
Summary: Improve the lazy pref getter hacky workaround → Use the lazy pref getter workaround for SHOW_OTHER_BOOKMARKS.
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/abd24a07274d
Use the lazy pref getter workaround for SHOW_OTHER_BOOKMARKS. r=Gijs

kmag pointed out an issue with my patch I'll have to follow up on. Feel free to back it out.

Keywords: leave-open

This can also touch the doc, so we don't want to run it if the
doc has been unlinked.

Keywords: leave-open
Pushed by amccreight@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/335755f56e63
Don't run maybeShowOtherBookmarksFolder if doc has gone away. r=kmag
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch
See Also: → 1779427
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: