Bug 1792457 - Revert workarounds for weak references to XPCWJS crashes. r=Gijs

I have fixed the underlying XPConnect issue, so these workarounds should
no longer be needed.

There are also two more in browser/base/content/browser-siteProtections.js
that I have not fixed.

Differential Revision: https://phabricator.services.mozilla.com/D158158
This commit is contained in:
Andrew McCreight
2022-09-29 11:40:19 +00:00
parent 72b07044d2
commit 670df172aa
4 changed files with 6 additions and 36 deletions

View File

@@ -17,21 +17,16 @@ XPCOMUtils.defineLazyPreferenceGetter(
false
);
/* Work around the pref callback being run after the document has been unlinked.
See bug 1543537. */
var docWeak = Cu.getWeakReference(document);
XPCOMUtils.defineLazyPreferenceGetter(
this,
"SHOW_OTHER_BOOKMARKS",
"browser.toolbars.bookmarks.showOtherBookmarks",
true,
(aPref, aPrevVal, aNewVal) => {
let doc = docWeak.get();
if (!doc) {
return;
}
BookmarkingUI.maybeShowOtherBookmarksFolder();
doc.getElementById("PlacesToolbar")?._placesView?.updateNodesVisibility();
document
.getElementById("PlacesToolbar")
?._placesView?.updateNodesVisibility();
}
);
ChromeUtils.defineModuleGetter(