Closed Bug 791273 Opened 12 years ago Closed 12 years ago

nsSuiteGlue does unnecessary work when there are no new add-ons installed (Port Bug 727637).

Categories

(SeaMonkey :: General, defect)

defect
Not set
normal

Tracking

(seamonkey2.17 fixed)

RESOLVED FIXED
seamonkey2.17
Tracking Status
seamonkey2.17 --- fixed

People

(Reporter: philip.chee, Assigned: ewong)

Details

(Whiteboard: [good first bug][lang=js][mentor=Philip.Chee][level=apprentice])

Attachments

(1 file, 3 obsolete files)

From Bug 727637 Comment 0:

> In nsBrowserGlue, _onWindowsRestored checks for newly installed addons - if there are 
> any then it opens tabs for about:newaddon. However, if there are *not* any new addons, 
> then it still unnecessary uses the Add-ons Manager API to fetch data for an empty list 
> of addons.

The Firefox patch is here:
https://hg.mozilla.org/mozilla-central/rev/e4901b5d891a

Our equivalent file is nsSuiteGlue.js:
http://mxr.mozilla.org/comm-central/source/suite/common/src/nsSuiteGlue.js

And the part to change is here:
http://mxr.mozilla.org/comm-central/source/suite/common/src/nsSuiteGlue.js?rev=9e6f4b466746&mark=324-334#317
Assignee: nobody → marioalv.mozilla
Assignee: marioalv.mozilla → nobody
Assignee: nobody → ewong
Status: NEW → ASSIGNED
Attachment #687353 - Flags: feedback?(philip.chee)
Comment on attachment 687353 [details] [diff] [review]
Ignore processing if list of changed add-ons is zero. (v1)

You might want to change the AddonManager.jsm import to a LazyModuleGetter like in the Firefox patch:

https://hg.mozilla.org/mozilla-central/rev/e4901b5d891a#l1.18

> +XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
> +                                  "resource://gre/modules/AddonManager.jsm");

> +    if (changedIDs.length > 0) {
Just use:
  if (changedIDs.length) {
Attachment #687353 - Flags: feedback?(philip.chee) → feedback+
Attachment #687353 - Attachment is obsolete: true
Attachment #687607 - Flags: review?(neil)
Attachment #687607 - Flags: feedback+
Attachment #687607 - Attachment is obsolete: true
Attachment #687607 - Flags: review?(neil)
Attachment #687665 - Flags: review?(neil)
Attachment #687665 - Flags: feedback+
Attachment #687665 - Flags: feedback+ → feedback?(philip.chee)
Comment on attachment 687665 [details] [diff] [review]
Ignore processing if list of changed add-ons is zero. (v3)

I thought AddonManager was in the startup path anyway (navigator.js loads it for instance) but I guess it won't hurt. r=me based on looking at a -w diff.
Attachment #687665 - Flags: review?(neil) → review+
Comment on attachment 687665 [details] [diff] [review]
Ignore processing if list of changed add-ons is zero. (v3)

> +XPCOMUtils.defineLazyModuleGetter(this, "AddonManager",
> +                                  "resource//gre/modules/AddonManager.jsm");
I don't know why but changing the import() to a LazyModuleGetter stops the code from working. r=me if you revert this change back to:

Components.utils.import("resource://gre/modules/AddonManager.jsm");
Attachment #687665 - Flags: feedback?(philip.chee) → feedback+
Attachment #687665 - Attachment is obsolete: true
Attachment #688537 - Flags: review?(neil)
Attachment #688537 - Flags: feedback+
Attachment #688537 - Flags: review?(neil) → review+
Pushed to comm-central:
http://hg.mozilla.org/comm-central/rev/fde7ce3d8e53
Target Milestone: --- → seamonkey2.17
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: