Closed Bug 1554559 Opened 6 years ago Closed 6 years ago

"Once" preferences should have a constant value during the lifetime of the parent process.

Categories

(Core :: Preferences: Backend, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla69
Tracking Status
firefox69 --- fixed

People

(Reporter: jya, Assigned: jya)

References

Details

Attachments

(3 files)

This is an issue that existed with gfxPrefs which I believe needs to be addressed.

gfxPrefs was initialised at various points and varied according to the process type.

In all processes where xpcom/Preferences was setup (necko, content processes) gfxPrefs were initialised based on the underlying Preferences.
Once preferences as such would be based on the value of that Preference at the time the process was created.
That means that if the preference had been changed since the parent process started, you could have Once gfxPrefs having different values between content process.

In process without xpcom (GPU and RDD process) the gfxPrefs were initialiased first when the process was created with their default value. And in the respective process RecvInit method, they would then set to the updated value of the gfxPrefs as it existed in the Parent process.

So GPU and RDD gfxPrefs Once gfxPrefs didn't change.
Then the RDD enabled xpcom in bug 1539029; after that it would have the same behaviour of the content processes: gfxPrefs Once being set to the preference value at the time the process got launched.

In bug 1548795 we removed gfxPrefs and now use StaticPrefs.

But those have the same issue as gfxPrefs in xpcom enabled process: The Once StaticPrefs are set to the preference value at the time the process is launched. And as such, can vary between process.

Similar to bug 1554334. We want to add consistency to what Once preferences.

I believe it should always be the same across all processes, regardless of the time those processes were launched.

Will also silence static analysis in phabricator whenever a caller of this code is used.

This allows for an entry to not show in about:config.

This will be used to store Once StaticPrefs once they become immutable.

Depends on D33419

When we create the SharedPreferenceMap we store the value of the Once pref in it. All child processes will now read the Once pref from the read-only SharedPreferenceMap.
This makes the Once prefs immutable once we start the first child process.

Depends on D33420

See Also: → 1424433
See Also: 1424433
Assignee: nobody → jyavenard

:kmag, friendly reminder that those changes are waiting for your review.

Flags: needinfo?(kmaglione+bmo)
Blocks: 1557630
Pushed by jyavenard@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/bf6105304228 P1. Test for invalid arguments. r=kershaw https://hg.mozilla.org/integration/autoland/rev/6a6477be5a1c P2. Add option for pref entry in SharedPrefMap to be skipped by iterator. r=njn https://hg.mozilla.org/integration/autoland/rev/a0de9c43eb20 P3. Make Once StaticPrefs immutable once SharedPreferenceMap has been created. r=njn
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla69
Flags: needinfo?(kmaglione+bmo)
See Also: → 1613124
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: