Closed
Bug 1249157
Opened 9 years ago
Closed 9 years ago
Wrap preference hash entry flags into a class, separate them from nsIPrefBranch enums
Categories
(Core :: Preferences: Backend, defect)
Core
Preferences: Backend
Tracking
()
RESOLVED
FIXED
mozilla47
Tracking | Status | |
---|---|---|
firefox47 | --- | fixed |
People
(Reporter: milan, Assigned: milan)
References
Details
Attachments
(1 file, 1 obsolete file)
We are mixing enums from prefapi.h and nsIPrefBranch.idl, using the same names, counting on values being the same. Make the ones from prefapi to an enum class, so that type checking helps. Hide the internal values for flags, make it harder for the user to check the wrong thing, or set the type to be both string and int and bool.
Assignee | ||
Comment 1•9 years ago
|
||
This is a first step in attempting larger things with preferences, but it should stand on its own and make things cleaner and safer.
Assignee | ||
Updated•9 years ago
|
Assignee: nobody → milan
Assignee | ||
Comment 2•9 years ago
|
||
Review commit: https://reviewboard.mozilla.org/r/35359/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/35359/
Attachment #8720544 -
Flags: review?(benjamin)
Comment 3•9 years ago
|
||
Comment on attachment 8720544 [details]
MozReview Request: Bug 1249157: prefapi enums into class enums, explicit conversion, cleanup. r=bsmedberg
https://reviewboard.mozilla.org/r/35359/#review32029
::: modules/libpref/prefapi.h:98
(Diff revision 1)
> +
Whitespace at end of line.
::: modules/libpref/prefapi.h:106
(Diff revision 1)
> + enum {
whitespace
::: modules/libpref/prefapi.h:115
(Diff revision 1)
> + uint16_t mValue;
Did you consider using c++ bitfields instead of an int here? e.g.
uint16_t mType:2;
bool mIsLocked:1;
bool mIsUserSet:1;
bool mIsConfig:1;
I'm not sure it really matters, so I'll leave it up to you, but manual bit-twiddling always worries me.
::: modules/libpref/prefapi.cpp:652
(Diff revision 1)
> - }
> + }
I may be being faked out by reviewboard here, but are there extraneous merge markers here?
Attachment #8720544 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 4•9 years ago
|
||
I'll check for the extra merge markers and fix the whitespace.
Bitfield is a good idea. I left what we had there before, so I'll either create a second patch for this bug or deal with that in another bug.
Assignee | ||
Comment 5•9 years ago
|
||
Comment on attachment 8720544 [details]
MozReview Request: Bug 1249157: prefapi enums into class enums, explicit conversion, cleanup. r=bsmedberg
Review request updated; see interdiff: https://reviewboard.mozilla.org/r/35359/diff/1-2/
Attachment #8720544 -
Attachment description: MozReview Request: Bug 1249157: prefapi enums into class enums, explicit conversion, cleanup. r?bsmedberg → MozReview Request: Bug 1249157: prefapi enums into class enums, explicit conversion, cleanup. r=bsmedberg
Assignee | ||
Comment 6•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=06b5ddc148b7 for the updates.
Backed out for build bustage: https://treeherder.mozilla.org/logviewer.html#?job_id=22110980&repo=mozilla-inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/effc082711b0
Flags: needinfo?(milan)
Assignee | ||
Comment 9•9 years ago
|
||
Thanks. I pushed the previous version, instead of the one from comment 7.
Flags: needinfo?(milan)
Assignee | ||
Comment 10•9 years ago
|
||
The actual version to land.
Attachment #8720544 -
Attachment is obsolete: true
Attachment #8722043 -
Flags: review+
Assignee | ||
Comment 11•9 years ago
|
||
https://treeherder.mozilla.org/#/jobs?repo=try&revision=fe53dc162b59 for one more sanity check.
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 12•9 years ago
|
||
Keywords: checkin-needed
Comment 13•9 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla47
You need to log in
before you can comment on or make changes to this bug.
Description
•