Closed
Bug 697314
Opened 13 years ago
Closed 11 years ago
Defer importing xpinstall permissions until necessary
Categories
(Toolkit :: Add-ons Manager, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: mossop, Assigned: Unfocused)
References
Details
(Whiteboard: [qa-])
Attachments
(1 file)
11.43 KB,
patch
|
Unfocused
:
review+
|
Details | Diff | Splinter Review |
Currently on the startup of a new version of an app we import any xpinstall whitelist prefs into the permissions manager. This is obviously causing the permissions manager to spin up its database because the single pref we currently import on first run is costing us 100ms.
Reporter | ||
Comment 1•13 years ago
|
||
Additionally Fennec frequently doesn't save prefs when quitting so we attempt to re-import on most startups, after the first run this only costs 15ms but still.
Of course if the permissions manager has to come up at some point during startup then it probably doesn't matter that we do it in the add-ons manager
Assignee | ||
Comment 2•13 years ago
|
||
Is there any downside to deferring this to when there's a requested addon install? Aside from the management UI, of course - I figure that could send an observer notification to flush any changes.
Reporter | ||
Comment 3•13 years ago
|
||
(In reply to Blair McBride (:Unfocused) from comment #2)
> Is there any downside to deferring this to when there's a requested addon
> install? Aside from the management UI, of course - I figure that could send
> an observer notification to flush any changes.
No downside, the only reason I did it on first startup is because previously there were three different places that were importing the prefs to the DB and I wanted to centralise it. Some signal to a central place seems like a good option.
Assignee | ||
Updated•11 years ago
|
Assignee: nobody → bmcbride
Status: NEW → ASSIGNED
Assignee | ||
Comment 4•11 years ago
|
||
Attachment #818840 -
Flags: review?(dtownsend+bugmail)
Reporter | ||
Comment 5•11 years ago
|
||
Comment on attachment 818840 [details] [diff] [review]
Patch v1
Review of attachment 818840 [details] [diff] [review]:
-----------------------------------------------------------------
Since all importPermissions does now is call out to PermissionsUtils, wouldn't it be easier to just do that directly from each place rather than call the observer service to trigger it?
::: toolkit/mozapps/extensions/XPIProvider.jsm
@@ +1806,5 @@
> this.enabledAddons = "";
>
> Services.prefs.addObserver(PREF_EM_MIN_COMPAT_APP_VERSION, this, false);
> Services.prefs.addObserver(PREF_EM_MIN_COMPAT_PLATFORM_VERSION, this, false);
> + Services.obs.addObserver(this, NOTIFICATION_FLUSH_PERMISSIONS, false);
false for a string?
Attachment #818840 -
Flags: review?(dtownsend+bugmail) → review-
Assignee | ||
Comment 6•11 years ago
|
||
Comment on attachment 818840 [details] [diff] [review]
Patch v1
14:18 <•Mossop> So basically ignore everything I said in that review
Attachment #818840 -
Flags: review- → review+
Assignee | ||
Comment 7•11 years ago
|
||
Assignee | ||
Updated•11 years ago
|
OS: Mac OS X → All
Hardware: x86 → All
Version: 8 Branch → unspecified
Comment 8•11 years ago
|
||
(In reply to Blair McBride [:Unfocused] from comment #6)
> 14:18 <•Mossop> So basically ignore everything I said in that review
Why?
Comment 9•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla27
Assignee | ||
Comment 10•11 years ago
|
||
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #8)
> Why?
For the first point, he misunderstood what I was doing. For the second point, he misread addObserver as notifyObservers.
OS: All → Mac OS X
Hardware: All → x86
Target Milestone: mozilla27 → ---
Version: unspecified → 8 Branch
Comment 11•11 years ago
|
||
Marking as [qa-] based on the existing automated test in the patch.
Updated•11 years ago
|
Whiteboard: [qa-]
You need to log in
before you can comment on or make changes to this bug.
Description
•