Closed Bug 720419 Opened 13 years ago Closed 1 years ago

nsIPrefBranch.resetBranch: Either remove or implement

Categories

(Core :: Preferences: Backend, enhancement)

x86_64
All
enhancement

Tracking

()

RESOLVED FIXED
116 Branch
Tracking Status
firefox116 --- fixed

People

(Reporter: WeirdAl, Assigned: marco)

References

(Blocks 1 open bug, )

Details

(Whiteboard: [overhead:noted])

Attachments

(1 file, 1 obsolete file)

/* void resetBranch (in string startingAt); */ NS_IMETHODIMP nsPrefBranch::ResetBranch(const char *aStartingAt) { return NS_ERROR_NOT_IMPLEMENTED; } It's been this way for years: a method defined in IDL but never, ever implemented. We need to do something about that.
If we had this method, we could remove the `resetBranch` custom implementation from Preferences.jsm.
Blocks: 1357517
Blocks: 1385954
No longer blocks: 1357517
Whiteboard: [overhead:noted]
We're removing Preferences.jsm from Sync over in bug 1406475, and use `resetBranch` several times in the tests.
Assignee: nobody → lina
Blocks: 1406475
Status: NEW → ASSIGNED
Type: defect → enhancement

:kmag's thorough review comment suggests we want to move to a world where we reset individual prefs, not whole branches. I'll keep the bug open in case someone would like to pursue that, but I'm not planning to take this over the line, sorry.

Assignee: lina → nobody
Status: ASSIGNED → NEW
Attachment #9023776 - Attachment is obsolete: true
Severity: normal → S3

Make it so callers need to explicitly iterate through prefs using getChildList
when they want to reset an entire branch, to avoid the footgun of resetting
unintended prefs when using resetBranch for clearing a single pref.
See also https://phabricator.services.mozilla.com/D11381#357618.

Assignee: nobody → mcastelluccio
Status: NEW → ASSIGNED
No longer blocks: 1406475
Pushed by mcastelluccio@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/1c7929ef20d2 Remove nsIPrefBranch::ResetBranch. r=KrisWright
Status: ASSIGNED → RESOLVED
Closed: 1 years 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: