Closed Bug 1186448 Opened 5 years ago Closed 5 years ago

pdfjschildbootstrap.js is executed every time a browser is opened, and should only run once per child process

Categories

(Firefox :: PDF Viewer, defect, P3)

defect

Tracking

()

RESOLVED FIXED
Firefox 42
Tracking Status
firefox42 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

(Blocks 1 open bug)

Details

(Keywords: perf, Whiteboard: [pdfjs-c-integration])

Attachments

(1 file)

It looks like pdfjschildbootstrap.js is loaded in nsBrowserGlue.js into the window message manager, such that it is executed every time a browser is loaded.

I'm reasonably certain this should only run once per child process, and not once per browser.

Am I right on that, jimm?
Flags: needinfo?(jmathies)
Note that if we moved this to running only once per process as opposed to once per browser, this would eliminate a sync message that PdfjsContentUtils sends in order to figure out whether or not it's the default PDF handler. That'd be a nice result.
(In reply to Mike Conley (:mconley) - Needinfo me! from comment #0)
> It looks like pdfjschildbootstrap.js is loaded in nsBrowserGlue.js into the
> window message manager, such that it is executed every time a browser is
> loaded.
> 
> I'm reasonably certain this should only run once per child process, and not
> once per browser.
> 
> Am I right on that, jimm?

Yes I think so. The script needs to load into every process via a single call here, I'm guessing there's something for that?
Flags: needinfo?(jmathies)
Yeah, I believe billm added the ability to use "process scripts": 

https://developer.mozilla.org/en-US/Firefox/Multiprocess_Firefox/Message_Manager/Process_scripts

vladan - can I assign this to your intern?
Flags: needinfo?(vdjeric)
Flags: needinfo?(vdjeric)
Mentor: mconley
Keywords: perf
Whiteboard: [good first bug]
Priority: -- → P3
Whiteboard: [good first bug] → [good first bug][pdfjs-c-integration]
Bug 1186448 - pdfjschildbootstrap.js should only be executed once per child process. r?jimm
Attachment #8643275 - Flags: review?(jmathies)
Comment on attachment 8643275 [details]
MozReview Request: Bug 1186448 - pdfjschildbootstrap.js should only be executed once per child process. r?jimm

https://reviewboard.mozilla.org/r/15013/#review13531

I'd suggest pushing to try as there are some basic tests for pdfjs in browser chrome.
Attachment #8643275 - Flags: review?(jmathies) → review+
Blocks: 1174239
Keywords: checkin-needed
url:        https://hg.mozilla.org/integration/fx-team/rev/670b14b5b033de46a55acfa8c985a116fefdffea
changeset:  670b14b5b033de46a55acfa8c985a116fefdffea
user:       Mike Conley <mconley@mozilla.com>
date:       Tue Aug 04 15:55:54 2015 -0400
description:
Bug 1186448 - pdfjschildbootstrap.js should only be executed once per child process. r=jimm

We were executing it once per tab, originally.
Mentor: mconley
Keywords: checkin-needed
Whiteboard: [good first bug][pdfjs-c-integration] → [pdfjs-c-integration]
https://hg.mozilla.org/mozilla-central/rev/670b14b5b033
Assignee: nobody → mconley
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 42
You need to log in before you can comment on or make changes to this bug.