Closed Bug 788378 Opened 12 years ago Closed 6 years ago

Add guards to the AddonManager/AddonManagerInternal getters and setters, to ensure they're not used before startup/after shutdown

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

RESOLVED INACTIVE
mozilla18

People

(Reporter: Unfocused, Assigned: Unfocused)

References

Details

Attachments

(1 file)

Bug 787253 was caused by using the .checkCompatibility setter before the AddonManager had initialized. This isn't a problem on normal Nightly builds, as PREF_EM_CHECK_COMPATIBILITY is set when AddonManager.jsm is loaded when running on the nightly channel. This isn't the case for non-nightly channels such as aurora, beta, release, esr. So similar to bug 782881, that setter should have a guard in place, so it's guaranteed to work consistently for all channels.
Attached patch Patch v1Splinter Review
Ended up doing this for all setters/getters, since their values are all initially set in startup(), and we stop observing pref changes after shutdown(). And it doesn't really make sense to allow using their setters when the getters won't work. test_shutdown.js now fails without the patch for bug 787253 (currently on fx-team).
Attachment #658391 - Flags: review?(dtownsend+bugmail)
Summary: Add a guard to the AddonAddonManagerInternal.checkCompatibility setter, to ensure its only used after startup → Add guards to the AddonManager/AddonManagerInternal getters and setters, to ensure they're not used before startup/after shutdown
Comment on attachment 658391 [details] [diff] [review] Patch v1 Review of attachment 658391 [details] [diff] [review]: ----------------------------------------------------------------- ::: toolkit/mozapps/extensions/test/xpcshell/test_shutdown.js @@ +54,5 @@ > + } > + if (typeof desc.set == "function" && aIgnore.setters.indexOf(prop) == -1) { > + do_print(aObjName + "." + prop + " setter"); > + try { > + obj[prop] = "i am the walrus"; r++
Attachment #658391 - Flags: review?(dtownsend+bugmail) → review+
Aaaaand backed out, thanks to debug-only xpcshell orange. I forgot to add __AddonManagerInternal__ to the ignore list :\ https://hg.mozilla.org/integration/fx-team/rev/ff05869f99ba
Whiteboard: [fixed-in-fx-team] → [backed out]
Relanded, with that property ignored, and after a successful Try run: https://hg.mozilla.org/integration/fx-team/rev/9a02263d7206
Whiteboard: [backed out] → [fixed-in-fx-team]
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla18
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: REOPENED → RESOLVED
Closed: 12 years ago6 years ago
Resolution: --- → INACTIVE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: