Closed
Bug 1413085
Opened 7 years ago
Closed 7 years ago
Make PREF_Get{CString,Int,Bool}Pref() more uniform
Categories
(Core :: Preferences: Backend, enhancement)
Core
Preferences: Backend
Tracking
()
RESOLVED
FIXED
mozilla58
| Tracking | Status | |
|---|---|---|
| firefox58 | --- | fixed |
People
(Reporter: n.nethercote, Assigned: n.nethercote)
References
Details
Attachments
(2 files)
No description provided.
| Comment hidden (mozreview-request) |
| Assignee | ||
Updated•7 years ago
|
Blocks: prefs-cleanup
| Comment hidden (mozreview-request) |
Comment 3•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8923677 [details]
Bug 1413085 - Make PREF_Get{CString,Int,Bool}Pref() more uniform. .
https://reviewboard.mozilla.org/r/194802/#review199898
Should GetIntPref and GetBoolPref reset aValueOut on error?
Attachment #8923677 -
Flags: review?(mh+mozilla) → review+
Comment 4•7 years ago
|
||
| mozreview-review | ||
Comment on attachment 8923680 [details]
Bug 1413085 - Inline and remove pref_SetPref(). .
https://reviewboard.mozilla.org/r/194804/#review199900
::: modules/libpref/Preferences.cpp:4104
(Diff revision 1)
> + rv = SetPrefValue(prefName, defaultValue.get_PrefValue(), DEFAULT_VALUE);
> + if (NS_FAILED(rv)) {
you could do `if (NS_FAILED(SetPrefValue(...))` and not have rv at all. If you still prefer to have rv = ... ; if (NS_FAILED(rv)), at least move the variable declaration here.
Attachment #8923680 -
Flags: review?(mh+mozilla) → review+
| Assignee | ||
Comment 5•7 years ago
|
||
> Should GetIntPref and GetBoolPref reset aValueOut on error?
They don't currently, so I'll leave them unchanged. Assuming anything about outparams on failure is a bad idea.
Some GetStringPref() do that, unfortunately, and the Voiding is required. I will probably add some MOZ_MUST_USE and [must_use] annotations to fix up these uses.
| Assignee | ||
Comment 6•7 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/870f7ca1b57a0b68f123eca351bea20d2ae1922e
Bug 1413085 - Make PREF_Get{CString,Int,Bool}Pref() more uniform. r=glandium.
https://hg.mozilla.org/integration/mozilla-inbound/rev/fa42202670b85ee2ef0a66f3948b2a4357d68c0a
Bug 1413085 - Inline and remove pref_SetPref(). r=glandium.
Comment 7•7 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/870f7ca1b57a
https://hg.mozilla.org/mozilla-central/rev/fa42202670b8
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
You need to log in
before you can comment on or make changes to this bug.
Description
•