This repository was archived by the owner on Sep 6, 2021. It is now read-only.
Fix #7442: make API consistent between PrefMan and Prefixed PrefMan.#7564
Merged
Fix #7442: make API consistent between PrefMan and Prefixed PrefMan.#7564
Conversation
The slightly higher level API provided by PreferencesManager (over the PreferencesBase.PreferencesSystem) worked nicely but was inconsistent with the API an extension author gets when they call `PreferencesManager.getExtensionPrefs`. This change pushes that extra behavior down into PreferencesBase.PreferencesSystem so that the APIs are consistent. This is a non-breaking change that basically adds to the API: * doNotSave flag for set: calls to `set()` save automatically unless this flag is set. If extension code is already calling `save()`, that means that there will be an extra call to `save()`, but that should have minimal performance impact because `save()` does no saving when the scopes aren't dirty * support for string contexts: extensions would have to use complete object contexts previously. This adds support for the simpler string contexts and doesn't change the behavior for object contexts.
Contributor
Author
|
@jasonsanjose this will fix up the pain you had with preferences in your extension recently. |
Member
|
Great, thanks! |
Contributor
|
Looks good. Merging. |
redmunds
added a commit
that referenced
this pull request
Apr 18, 2014
Fix #7442: make API consistent between PrefMan and Prefixed PrefMan.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix for #7442
The slightly higher level API provided by PreferencesManager (over the
PreferencesBase.PreferencesSystem) worked nicely but was inconsistent
with the API an extension author gets when they call
PreferencesManager.getExtensionPrefs. This change pushes that extrabehavior down into PreferencesBase.PreferencesSystem so that the
APIs are consistent.
This is a non-breaking change that basically adds to the API:
set()save automatically unless this flag is set. If extension code is already callingsave(), that means that there will be an extra call tosave(), but that should have minimal performance impact becausesave()does no saving when the scopes aren't dirty