Closed
Bug 568348
Opened 15 years ago
Closed 15 years ago
The extension manager should do extension install activities and write extensions.ini before the profile is started
Categories
(Toolkit :: Add-ons Manager, defect)
Toolkit
Add-ons Manager
Tracking
()
VERIFIED
FIXED
mozilla2.0b1
Tracking | Status | |
---|---|---|
blocking2.0 | --- | final+ |
People
(Reporter: benjamin, Assigned: benedict)
References
Details
(Whiteboard: [AddonsRewrite][AOMTestday])
Attachments
(2 files, 3 obsolete files)
13.88 KB,
patch
|
Details | Diff | Splinter Review | |
3.98 KB,
patch
|
mossop
:
review+
|
Details | Diff | Splinter Review |
In preparation for getting rid of the extension manager restart, the extension manager should do extension install/uninstall activities before the profile-after-change notification.
http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/addonManager.js#74 is where the extension manager currently watches for profile-after-change.
It registers for profile-after-change in the category manager here: http://mxr.mozilla.org/mozilla-central/source/toolkit/mozapps/extensions/addonManager.js#173
The profile change notifications are fired from here:
http://mxr.mozilla.org/mozilla-central/source/toolkit/xre/nsXREDirProvider.cpp#821
We should add a new notification prior to the profile actually being notified which the extension manager can use instead.
This may also involve teaching the pref service and perhaps some other services about loading data prior to the official profile-change notifications.
Comment 1•15 years ago
|
||
Is it something we wanna have for 1.9.3 final?
blocking2.0: --- → ?
OS: Mac OS X → All
Hardware: x86 → All
Whiteboard: [AddonsRewrite]
Version: unspecified → Trunk
Comment 2•15 years ago
|
||
I think Benjamin said we needed this for Fx4. This may well fix bug 567612
Blocks: 567612
blocking2.0: ? → beta1+
Updated•15 years ago
|
blocking2.0: beta1+ → final+
Assignee | ||
Comment 3•15 years ago
|
||
Creates observer notification 'em-start' that is sent before mProfileNotified is flipped to true or profile-do-change is sent in nsXREDirProvider. Modified extensionManager and prefService to start at this time.
There's still an issue (in XPIProvider.jsm, I think) preventing extensions.ini from being written. Also, right now I'm just referencing ProfDS, bsmedberg suggested that I might want to fix NS_APP_PREFS_50_DIR/FILE to work before profile-do-change.
Comment 4•15 years ago
|
||
Just a thought, but maybe it would be easier to leave profile-do-change triggering the pref service load (and anything else the EM requires on) and then adding our new notification between that and profile-after-change. The new notification need not even go through the observer service as such, you could just instantiate the EM component and call it's nsIObserver interface directly.
Reporter | ||
Comment 5•15 years ago
|
||
That would mean that extensions couldn't observer profile-do-change (only profile-after-change). I guess that might be ok.
Comment 6•15 years ago
|
||
(In reply to comment #5)
> That would mean that extensions couldn't observer profile-do-change (only
> profile-after-change). I guess that might be ok.
We're already removing the option of observing xpcom-startup and app-startup from extension components by making these changes (which we probably need to announce pretty soon). Without those it would be impossible to register to receive profile-do-change anyway.
The add-ons mxr seems broken right now but I don't believe that profile-do-change will be used much anyway. profile-after-change is the one I have always heard recommended for use by extensions and I have never come across a situation where the slightly earlier event is necessary.
Assignee | ||
Comment 7•15 years ago
|
||
starts extension manager with new 'em-start' notification, before profile-do-change
Attachment #448871 -
Attachment is obsolete: true
Assignee | ||
Comment 8•15 years ago
|
||
Patch using Mossop's suggested approach, seems a bit simpler.
Assignee | ||
Comment 9•15 years ago
|
||
a bit simpler than the original patch, and fixes xpcshell tests. still need to look into which mochitests to run.
Attachment #450158 -
Attachment is obsolete: true
Reporter | ||
Comment 10•15 years ago
|
||
Any reason we can't go ahead and get this reviewed while you're testing?
Assignee | ||
Comment 11•15 years ago
|
||
Comment on attachment 450273 [details] [diff] [review]
starts extension manager after profile-do-change, before profile-after change
browser-chrome tests look good.
Attachment #450273 -
Flags: review?(dtownsend)
Comment 12•15 years ago
|
||
Comment on attachment 450273 [details] [diff] [review]
starts extension manager after profile-do-change, before profile-after change
>diff --git a/toolkit/mozapps/extensions/addonManager.js b/toolkit/mozapps/extensions/addonManager.js
> amManager.prototype = {
> observe: function AMC_observe(aSubject, aTopic, aData) {
> let os = Cc["@mozilla.org/observer-service;1"].
> getService(Ci.nsIObserverService);
>
> switch (aTopic) {
>- case "profile-after-change":
>+ case "em-start":
I think we need a better name for this, maybe addons-startup
> classDescription: "Addons Manager",
> contractID: "@mozilla.org/addons/integration;1",
> classID: Components.ID("{4399533d-08d1-458c-a87a-235f74451cfa}"),
>- _xpcom_categories: [{ category: "profile-after-change" },
>+ _xpcom_categories: [{ category: "em-start" },
Registering it the category is unnecessary now.
> { category: "update-timer",
> value: "@mozilla.org/addons/integration;1," +
> "getService,addon-background-update-timer," +
> PREF_EM_UPDATE_INTERVAL + ",86400" }],
> _xpcom_factory: {
> createInstance: function(aOuter, aIid) {
> if (aOuter != null)
> throw Cr.NS_ERROR_NO_AGGREGATION;
>diff --git a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
>--- a/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
>+++ b/toolkit/mozapps/extensions/test/xpcshell/head_addons.js
>@@ -134,22 +134,21 @@
> if (gInternalManager)
> do_throw("Test attempt to startup manager that was already started.");
>
> if (aAppChanged === undefined)
> aAppChanged = true;
>
> // Load the add-ons list as it was during application startup
> loadAddonsList(aAppChanged);
>-
>+
Don't add whitespace please.
> gInternalManager = AM_Cc["@mozilla.org/addons/integration;1"].
> getService(AM_Ci.nsIObserver).
> QueryInterface(AM_Ci.nsITimerCallback);
>-
And leave this blank line in please.
>- gInternalManager.observe(null, "profile-after-change", "startup");
>+ gInternalManager.observe(null, "em-start", "startup");
No need to pass "startup" to it anymore.
Attachment #450273 -
Flags: review?(dtownsend) → review-
Assignee | ||
Comment 13•15 years ago
|
||
>I think we need a better name for this, maybe addons-startup
Changed.
>Registering it the category is unnecessary now.
Removed.
>No need to pass "startup" to it anymore.
Removed.
Sorry about the whitespace issues, fixed those.
Attachment #450273 -
Attachment is obsolete: true
Attachment #450421 -
Flags: review?(dtownsend)
Comment 14•15 years ago
|
||
Comment on attachment 450421 [details] [diff] [review]
fixes review comments.
Looks good
Attachment #450421 -
Flags: review?(dtownsend) → review+
Assignee | ||
Updated•15 years ago
|
Whiteboard: [AddonsRewrite] → [AddonsRewrite], checkin-needed
Updated•15 years ago
|
Keywords: checkin-needed
Whiteboard: [AddonsRewrite], checkin-needed → [AddonsRewrite]
Comment 15•15 years ago
|
||
Comment 16•15 years ago
|
||
Is there anything we can have tests for? Whether automated or manual?
Flags: in-testsuite?
Flags: in-litmus?
Target Milestone: --- → mozilla1.9.3a6
Comment 17•15 years ago
|
||
We can't really test this specifically. Once bug 568691 lands we'll probably have testing of this by the side effect of extensions working and there being no EM restart. I think the automated suites will just cover that as-is.
Updated•15 years ago
|
Flags: in-litmus? → in-litmus-
Comment 18•14 years ago
|
||
Haven't discovered any problems since bug 568691 has been landed. There is no EM restart anymore. Lets mark it as verified fixed.
Status: RESOLVED → VERIFIED
Whiteboard: [AddonsRewrite] → [AddonsRewrite][AOMTestday]
Comment 19•14 years ago
|
||
Per comment 17 we're doing as good as we can here I think
Flags: in-testsuite? → in-testsuite+
You need to log in
before you can comment on or make changes to this bug.
Description
•