Add an async version of nsIPrefService.savePrefFile that takes a path for a new file on disk
Categories
(Core :: Preferences: Backend, task)
Tracking
()
Tracking | Status | |
---|---|---|
firefox126 | --- | fixed |
People
(Reporter: mconley, Assigned: mconley)
References
(Blocks 1 open bug)
Details
(Whiteboard: [fidefe-device-migration])
Attachments
(1 file)
nsIPrefService.savePrefFile writes the prefs state to a local file: https://searchfox.org/mozilla-central/rev/202c48686136360a23b73a49b611a19e64f3e1b8/modules/libpref/nsIPrefService.idl#65-79
If passed null
, this writes it to the default prefs.js
file - however, callers can supply it with an nsIFile pointing at a new file to write to.
It looks like if you pass it an nsIFile
, we only do blocking writes: https://searchfox.org/mozilla-central/rev/202c48686136360a23b73a49b611a19e64f3e1b8/modules/libpref/Preferences.cpp#4397
The team working on profile backup would like to make it possible to flush prefs to a backup folder on disk without blocking the main thread, and either to return a Promise to indicate when it's done (or to fire an observer notification passing the nsIFile path as either topic or data. I'm open to either, or alternatives).
Instead of modifying the existing savePrefFile
method to accommodate that, I suspect it'll be easier to add an nsIPrefService.savePrefFileAsync
with this behaviour, since savePrefFile
is already fairly nuanced on when it chooses to write synchronously, and when it does not. I think we can probably simplify it a bit by having this new method not accept null
, and only accept a path that isn't the default prefs.js
path.
Assignee | ||
Updated•9 months ago
|
Updated•9 months ago
|
Assignee | ||
Comment 1•9 months ago
|
||
Updated•9 months ago
|
Assignee | ||
Updated•9 months ago
|
Comment 3•8 months ago
|
||
bugherder |
Description
•