Closed
Bug 1353174
Opened 7 years ago
Closed 7 years ago
Turn ContentObservers.jsm into a process script
Categories
(Firefox :: General, defect)
Firefox
General
Tracking
()
RESOLVED
FIXED
Firefox 55
Tracking | Status | |
---|---|---|
firefox55 | --- | fixed |
People
(Reporter: mccr8, Assigned: mccr8)
References
Details
Attachments
(2 files)
The comment at the top of ContentObserver.jsm says "This module is for small observers that we want to register once per content process, usually in order to forward content-based observer service notifications to the chrome process through message passing. Using a JSM avoids having them in content.js and thereby registering N observers for N open tabs, which is bad for perf." If we turn this into a process script (maybe loaded from nsBrowserGlue.js like pdf.js does) then we can get the benefits of running only once per process without the overhead of one jsm per content process.
Assignee | ||
Comment 1•7 years ago
|
||
try run: https://treeherder.mozilla.org/#/jobs?repo=try&revision=c6da979ca1393aa8e56c1ba149f6cf0ad1253fe1&filter-tier=1
Comment hidden (mozreview-request) |
Assignee | ||
Comment 3•7 years ago
|
||
Hmm, that's not a good diff. I'll see if I can get it to actually show the move. Somehow.Hmm, so that git
Comment 4•7 years ago
|
||
mozreview-review |
Comment on attachment 8854521 [details] Bug 1353174, part 1 - Turn ContentObservers.jsm into a process script. https://reviewboard.mozilla.org/r/126480/#review129010 ::: browser/components/nsBrowserGlue.js:862 (Diff revision 1) > + > + Services.ppmm.loadProcessScript("resource:///modules/ContentObservers.js", true); I think this is too late, and I'm not sure why pdfjs (higher up in this method) waits this long, either. This is firing after the delayed startup of the first browser window finishes, but content.js is added to the content browsers here: https://dxr.mozilla.org/mozilla-central/source/browser/base/content/browser.js#1154-1158 which is significantly earlier (onLoad rather than delayed startup).
Attachment #8854521 -
Flags: review?(gijskruitbosch+bugs)
Comment hidden (obsolete) |
Comment hidden (mozreview-request) |
Comment hidden (mozreview-request) |
Assignee | ||
Updated•7 years ago
|
Attachment #8854593 -
Flags: review?(gijskruitbosch+bugs)
Comment 8•7 years ago
|
||
mozreview-review |
Comment on attachment 8854593 [details] Bug 1353174, part 2 - Fix up ContentObservers.js. https://reviewboard.mozilla.org/r/126550/#review129088
Attachment #8854593 -
Flags: review?(gijskruitbosch+bugs) → review+
Comment 9•7 years ago
|
||
mozreview-review |
Comment on attachment 8854521 [details] Bug 1353174, part 1 - Turn ContentObservers.jsm into a process script. https://reviewboard.mozilla.org/r/126480/#review129090
Attachment #8854521 -
Flags: review?(gijskruitbosch+bugs) → review+
Assignee | ||
Comment 10•7 years ago
|
||
I didn't realize that browser.js is run once per browser window, though I suppose that makes sense. By putting this code in MainProcessSingleton.js it seems to load it once per process, as expected, and it loads before browser.js runs, so hopefully that is early enough, but not too early.
Comment 11•7 years ago
|
||
Pushed by amccreight@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/05ba30ffa434 part 1 - Turn ContentObservers.jsm into a process script. r=Gijs https://hg.mozilla.org/integration/autoland/rev/fe34ea100aa3 part 2 - Fix up ContentObservers.js. r=Gijs
Comment 12•7 years ago
|
||
I would have expected this to run into bug 1352982. I don't really understand why it didn't. Florian, do you?
Flags: needinfo?(florian)
Comment 13•7 years ago
|
||
(In reply to :Gijs from comment #12) > I would have expected this to run into bug 1352982. I don't really > understand why it didn't. Florian, do you? I don't really understand either. Is it possible that the browser_all_files_referenced.js test has not been run in any non-clobber os x build since this patch was pushed to autoland?
Flags: needinfo?(florian)
Comment 14•7 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/05ba30ffa434 https://hg.mozilla.org/mozilla-central/rev/fe34ea100aa3
Status: NEW → RESOLVED
Closed: 7 years ago
status-firefox55:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
You need to log in
before you can comment on or make changes to this bug.
Description
•