Closed Bug 1359040 Opened 7 years ago Closed 11 months ago

Consider removing Preferences.jsm usage from Telemetry

Categories

(Toolkit :: Telemetry, enhancement, P3)

enhancement

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox55 --- wontfix
firefox116 --- fixed

People

(Reporter: gfritzsche, Assigned: gregp)

References

(Blocks 1 open bug)

Details

(Whiteboard: [measurement:client][overhead:note])

Attachments

(1 file)

nsIPrefBranch now supports default return values etc.
Bug 1357517 considers removing Preferences.jsm now.

I think the only issues left for us would be a direct replacement for Preferences.has():
> <florian> .has is prefBranch.getPrefType(prefName) != Ci.nsIPrefBranch.PREF_INVALID
> <florian> isSet is prefBranch.prefHasUserValue(prefName)
I'm going to remove some of the Preferences.jsm uses from Telemetry in bug 1357517.

(In reply to Georg Fritzsche [:gfritzsche] from comment #0)
> I think the only issues left for us would be a direct replacement for
> Preferences.has()

The other thing that has to be replaced is Preferences.observe/Preferences.ignore.
After bug 1357517:
> toolkit/components/telemetry/TelemetryHealthPing.jsm:XPCOMUtils.defineLazyModuleGetter(this, "Preferences", "resource://gre/modules/Preferences.jsm");
> toolkit/components/telemetry/TelemetryModules.jsm:  "resource://gre/modules/Preferences.jsm");
> toolkit/components/telemetry/TelemetryArchive.jsm:Cu.import("resource://gre/modules/Preferences.jsm", this);
> toolkit/components/telemetry/TelemetryStorage.jsm:Cu.import("resource://gre/modules/Preferences.jsm", this);
> toolkit/components/telemetry/tests/unit/test_TelemetryModules.js:Cu.import("resource://gre/modules/Preferences.jsm");
> toolkit/components/telemetry/tests/unit/test_PingSender.js:Cu.import("resource://gre/modules/Preferences.jsm", this);
> toolkit/components/telemetry/tests/unit/test_TelemetryReportingPolicy.js:Cu.import("resource://gre/modules/Preferences.jsm", this);
> toolkit/components/telemetry/tests/unit/test_TelemetryEnvironment.js:Cu.import("resource://gre/modules/Preferences.jsm", this);
> toolkit/components/telemetry/tests/unit/test_SubsessionChaining.js:Cu.import("resource://gre/modules/Preferences.jsm", this);
> toolkit/components/telemetry/tests/unit/test_TelemetrySession.js:Cu.import("resource://gre/modules/Preferences.jsm");
> toolkit/components/telemetry/tests/unit/test_TelemetryController.js:Cu.import("resource://gre/modules/Preferences.jsm");
> toolkit/components/telemetry/tests/unit/test_TelemetryHealthPing.js:Cu.import("resource://gre/modules/Preferences.jsm", this);
No longer blocks: 1357517
Whiteboard: [measurement:client] → [measurement:client][overhead:note]
(In reply to Marco Castelluccio [:marco] from comment #1)
> I'm going to remove some of the Preferences.jsm uses from Telemetry in bug
> 1357517.
> 
> (In reply to Georg Fritzsche [:gfritzsche] from comment #0)
> > I think the only issues left for us would be a direct replacement for
> > Preferences.has()
> 
> The other thing that has to be replaced is
> Preferences.observe/Preferences.ignore.

We now have things like |XPCOMUtils.defineLazyPreferenceGetter| for that - https://searchfox.org/mozilla-central/rev/1193ef6a61cb6e350460eb2e8468184d3cb0321d/js/xpconnect/loader/XPCOMUtils.jsm#411
Type: defect → enhancement
Severity: normal → S3
Assignee: nobody → gp3033
Status: NEW → ASSIGNED
Attachment #9337057 - Attachment description: Bug 1359040 - Remove Preferences.sys.mjs usage from toolkit/components/telemetry r?chutten! → Bug 1359040 - Remove Preferences.sys.mjs usage from toolkit/components/telemetry r?chutten!
Pushed by chutten@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/67431719c7f0
Remove Preferences.sys.mjs usage from toolkit/components/telemetry r=chutten
Status: ASSIGNED → RESOLVED
Closed: 11 months ago
Resolution: --- → FIXED
Target Milestone: --- → 116 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: