Closed
Bug 910172
Opened 11 years ago
Closed 11 years ago
Refactor XPIProvider.importPermissions out to a reusable JSM
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
VERIFIED
FIXED
mozilla27
People
(Reporter: Unfocused, Assigned: Unfocused)
References
Details
Attachments
(1 file, 2 obsolete files)
10.81 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
XPIProvider.importPermissions() is useful for other components too, so would be useful to refactor that out to a reusable JSM.
Assignee | ||
Comment 1•11 years ago
|
||
Needs tests yet, but...
Assignee: nobody → bmcbride
Status: NEW → ASSIGNED
Attachment #796575 -
Flags: feedback?(dtownsend+bugmail)
Comment 2•11 years ago
|
||
Comment on attachment 796575 [details] [diff] [review]
910172.diff
Review of attachment 796575 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/modules/PermissionsUtils.jsm
@@ +48,5 @@
> + Services.perms.DENY_ACTION);
> +
> + gImportedPrefBranches.add(aPrefBranch);
> + }
> +};
Indenting is all weird here
::: toolkit/mozapps/extensions/XPIProvider.jsm
@@ +3096,5 @@
> * manager for the user to change later.
> */
> importPermissions: function XPI_importPermissions() {
> + PermissionsUtils.importFromPrefs(PREF_XPI_PERMISSIONS_BRANCH,
> + XPI_PERMISSION);
At the moment we do this early in startup to make sure the prefs have been imported before they are needed. With this shared code we could potentially only do this immediately before querying the pref service. Worth it?
Attachment #796575 -
Flags: feedback?(dtownsend+bugmail) → feedback+
Assignee | ||
Comment 3•11 years ago
|
||
(In reply to Dave Townsend (:Mossop) from comment #2)
> At the moment we do this early in startup to make sure the prefs have been
> imported before they are needed. With this shared code we could potentially
> only do this immediately before querying the pref service. Worth it?
Yep, bug 697314, which Irving and I hope to fix soonish. In addition to code-reuse, this is a tiny stepping stone toward both that and lazy-loading as much code as possible.
Assignee | ||
Comment 4•11 years ago
|
||
Now with a test and documentation (and a bug fix).
Attachment #796575 -
Attachment is obsolete: true
Attachment #814022 -
Flags: review?(dtownsend+bugmail)
Comment 5•11 years ago
|
||
Comment on attachment 814022 [details] [diff] [review]
Patch v1
Review of attachment 814022 [details] [diff] [review]:
-----------------------------------------------------------------
r+, I don't see the test though
Attachment #814022 -
Flags: review?(dtownsend+bugmail) → review+
Assignee | ||
Comment 6•11 years ago
|
||
Gah, that had me worried. Wrong version of the file? I dunno. This one has the test.
Attachment #814022 -
Attachment is obsolete: true
Attachment #814762 -
Flags: review?(dtownsend+bugmail)
Comment 7•11 years ago
|
||
Comment on attachment 814762 [details] [diff] [review]
Patch v1.00001
Review of attachment 814762 [details] [diff] [review]:
-----------------------------------------------------------------
Throw a test in where there is a leading or trailing comma in the pref and it's good to go.
Attachment #814762 -
Flags: review?(dtownsend+bugmail) → review+
Assignee | ||
Comment 8•11 years ago
|
||
Comment 9•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Assignee | ||
Comment 10•11 years ago
|
||
And a bustage fix landed for bug 925279:
https://hg.mozilla.org/mozilla-central/rev/40c7c53fe9b0
Comment 11•11 years ago
|
||
I confirm the fix is verified on Latest Nightly 28.
BuildID: 20131105030206
Status: RESOLVED → VERIFIED
You need to log in
before you can comment on or make changes to this bug.
Description
•