Closed
Bug 845863
Opened 12 years ago
Closed 12 years ago
Browser scripts (chrome) may be loaded more than once
Categories
(Firefox for Metro Graveyard :: General, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: sfoster, Assigned: sfoster)
References
Details
Attachments
(1 file)
2.07 KB,
patch
|
mbrubeck
:
review+
|
Details | Diff | Splinter Review |
When a single script provides more than one lazy-loadable symbol/module, the way scripts are loaded in browser-scripts causes the script to be loaded and interpreted each time. This is unnecessary overhead and results in loss of state and unpredictable behavior as objects are redefined.
This issue was observed with chrome://browser/content/TopSites.js, which provides TopSitesView, TopSitesSnappedView and TopSitesStartView - but applies equally to dowloads.js and others (present and future).
Assignee | ||
Comment 1•12 years ago
|
||
This issue is currently blocking testing and getting deterministic behavior from TopSites pin/unpin behavior.
Assignee | ||
Comment 2•12 years ago
|
||
First pass at a fix. I use a simple object lookup to stash the sandbox/context objects keyed by the script path. This allows us to skip the loadSubScript call for a script that is already loaded.
The side-effect is that now all the contexts are in scope in browser-scripts.js - previously those were scoped to the defineLazyGetter callback. I'm not sure if this has any consequences.
Attachment #719042 -
Flags: review?(mbrubeck)
Assignee | ||
Updated•12 years ago
|
Comment 3•12 years ago
|
||
Comment on attachment 719042 [details] [diff] [review]
Add a lookup for browser-scripts to allow loading a script only once
Thanks!
Attachment #719042 -
Flags: review?(mbrubeck) → review+
Assignee | ||
Comment 4•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 5•12 years ago
|
||
Reopening until this lands in mozilla-central.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Comment 6•12 years ago
|
||
Status: REOPENED → RESOLVED
Closed: 12 years ago → 12 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•