Closed Bug 1462516 Opened 7 years ago Closed 7 years ago

Move still more XPI database code out of XPIProvider

Categories

(Toolkit :: Add-ons Manager, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Most of it is already gone, but we still have a bunch of non-trivial code for querying the add-ons DB which is never needed before the DB is loaded.
Comment on attachment 8976758 [details] Bug 1462516: Move more XPI database code out of XPIProvider.jsm. https://reviewboard.mozilla.org/r/244862/#review251574 ::: toolkit/mozapps/extensions/internal/XPIDatabase.jsm:1907 (Diff revision 2) > * > - * @param {Array<string>?} aTypes > + * @param {Set<string>?} aTypes > * The types of add-ons to retrieve or null to get all types > * @returns {Promise<Array<AddonInternal>>} > */ > getVisibleAddonsWithPendingOperations(aTypes) { this function can just be removed now ::: toolkit/mozapps/extensions/internal/XPIDatabase.jsm:2424 (Diff revision 2) > > /** > + * Update the appDisabled property for all add-ons. > + */ > + updateAddonAppDisabledStates() { > + dump(`UPDATE ADS\n`); remove (also 2 lines down) ::: toolkit/mozapps/extensions/internal/XPIProvider.jsm (Diff revision 2) > - // If the database doesn't exist and there are add-ons installed then we > - // must update the database however if there are no add-ons then there is > - // no need to update the database. > - let dbFile = FileUtils.getFile(KEY_PROFILEDIR, [FILE_DATABASE], true); > - if (!dbFile.exists() && haveAnyAddons) { > - updateReasons.push("needNewDatabase"); > - } just to make sure I understand, this isn't necessary since it will just get handled in loadDB() ?
Attachment #8976758 - Flags: review?(aswan) → review+
Comment on attachment 8976758 [details] Bug 1462516: Move more XPI database code out of XPIProvider.jsm. https://reviewboard.mozilla.org/r/244862/#review251574 > this function can just be removed now Already did this after we discussed it on IRC. I guess pushing the updated patch failed and I didn't notice. > remove (also 2 lines down) Yeah, fixed that just after I pushed. > just to make sure I understand, this isn't necessary since it will just get handled in loadDB() ? Yup. There's no reason for us to force a DB rebuild at startup, in this (unlikely) case. It'll happen automatically when we load the DB after startup. Which means there's no need for the extra stat and code complexity that this adds.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
Is manual testing required on this bug? If yes, please provide some STR and the proper extension(if required) or set the “qe-verify -“ flag. Thanks!
Flags: needinfo?(kmaglione+bmo)
Flags: needinfo?(kmaglione+bmo) → qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: