Closed
Bug 807231
Opened 13 years ago
Closed 13 years ago
Add functions to manage date preferences
Categories
(Cloud Services :: Firefox: Common, defect)
Cloud Services
Firefox: Common
Tracking
(firefox18 fixed, firefox19 fixed, firefox20 fixed)
RESOLVED
FIXED
mozilla20
People
(Reporter: gps, Assigned: gps)
Details
Attachments
(1 file, 1 obsolete file)
7.62 KB,
patch
|
rnewman
:
review+
akeybl
:
approval-mozilla-aurora+
akeybl
:
approval-mozilla-beta+
|
Details | Diff | Splinter Review |
For FHR I wrote functions for savings Date instances to and from prefs. I needed to use these in multiple modules and figured they'd make a good addition to CommonUtils.
Attachment #676912 -
Flags: review?(rnewman)
Comment 1•13 years ago
|
||
Comment on attachment 676912 [details] [diff] [review]
Functions to manage date prefs, v1
Review of attachment 676912 [details] [diff] [review]:
-----------------------------------------------------------------
::: services/common/utils.js
@@ +531,5 @@
> +
> + valueInt = def;
> + }
> + } else {
> + valueInt = def;
Rather than doing this, split into getEpochPref, use returns instead of variable assignments, and define getDatePref in terms of it.
I'm sure there's a use for getEpochPref, and it avoids valueInt.
@@ +556,5 @@
> + * If the range check fails, an Error will be thrown instead of a default
> + * value silently being used.
> + *
> + * @param branch
> + * (Preference) Branch to use to save preference in.
"Branch in which to save preference value".
Attachment #676912 -
Flags: review?(rnewman) → review+
Assignee | ||
Comment 2•13 years ago
|
||
Incorporated review feedback.
Assignee: nobody → gps
Attachment #676912 -
Attachment is obsolete: true
Status: NEW → ASSIGNED
Attachment #677164 -
Flags: review?(rnewman)
Comment 3•13 years ago
|
||
Comment on attachment 677164 [details] [diff] [review]
Functions to manage date prefs, v2
Review of attachment 677164 [details] [diff] [review]:
-----------------------------------------------------------------
::: services/common/utils.js
@@ +506,5 @@
> + * (Number) The default value to use if the preference is not defined.
> + * @param thisObj
> + * (Object) Object to log warnings
> + */
> + getEpochPref: function getDatePref(branch, pref, def=0, thisObj=null) {
Function name is wrong.
@@ +548,5 @@
> + * (Number) The default value (in milliseconds) if the preference is
> + * not defined or invalid.
> + * @param thisObj
> + * (Object) Object to use for logging. If defined and it has a `_log`
> + * property, that Log4Moz logger will be used to record warnings.
Let's just pass in an optional `logger` instead.
Attachment #677164 -
Flags: review?(rnewman) → review+
Assignee | ||
Comment 4•13 years ago
|
||
Whiteboard: [fixed-in-larch]
Comment 5•13 years ago
|
||
Comment on attachment 677164 [details] [diff] [review]
Functions to manage date prefs, v2
Bulk-setting approval flags for FHR landing for FxOS ADU ping (Bug 788894).
Attachment #677164 -
Flags: approval-mozilla-beta?
Attachment #677164 -
Flags: approval-mozilla-aurora?
Comment 6•13 years ago
|
||
Whiteboard: [fixed-in-larch]
Updated•13 years ago
|
Target Milestone: --- → mozilla20
Comment 7•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Comment 8•13 years ago
|
||
Comment on attachment 677164 [details] [diff] [review]
Functions to manage date prefs, v2
FHR for B2G ADU ping, won't be built/enabled for Mobile/Desktop.
Attachment #677164 -
Flags: approval-mozilla-beta?
Attachment #677164 -
Flags: approval-mozilla-beta+
Attachment #677164 -
Flags: approval-mozilla-aurora?
Attachment #677164 -
Flags: approval-mozilla-aurora+
Comment 9•13 years ago
|
||
You need to log in
before you can comment on or make changes to this bug.
Description
•