Closed Bug 1474139 Opened 7 years ago Closed 7 years ago

Move content-sessionStore.js to a JSM

Categories

(Firefox :: Session Restore, enhancement, P1)

57 Branch
enhancement

Tracking

()

RESOLVED FIXED
Firefox 63
Tracking Status
firefox63 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [overhead:45k])

Attachments

(2 files)

Aside from causing a separate copy to be loaded into every content frameloader, loading this script as a framescript puts it in a different compartment from the rest of the JSMs, which means it creates a lot of extra wrapper, JS prototype, and self-hosted JS overhead. The bulk of the script should be a JSM loaded by a frame script.
Kris, sorry for the delay here. The patches are rather big :) They look good though and I'm making progress.
Blocks: 1475290
Actively worked on so P1
Blocks: ss-perf
Priority: -- → P1
Looking very good so far, prolly r+ tomorrow. Thanks for you patience!
(In reply to Mike de Boer [:mikedeboer] from comment #5) > Looking very good so far, prolly r+ tomorrow. Thanks for you patience! Cheers
Comment on attachment 8990556 [details] Bug 1474139: Part 1 - Refactor content-sessionSstore to not depend on running in a frame script global. https://reviewboard.mozilla.org/r/255622/#review264172 I have to say that I like that you introduced the 'Handler' generalization class. ::: commit-message-bfade:1 (Diff revision 1) > +Bug 1474139: Part 1 - Refactor content-sessionSstore to not depend on running in a frame script global. r?mikedeboer nit: 'content-sessionStore' (-s)
Attachment #8990556 - Flags: review?(mdeboer) → review+
Comment on attachment 8990557 [details] Bug 1474139: Part 2 - Move content-sessionStore to a separate JSM. https://reviewboard.mozilla.org/r/255624/#review264320 I see what you did here, but please try to use `hg mv` to make the diff smaller (the content-sessionStore.js deletions will be omitted in that case). r=me with that change!
Attachment #8990557 - Flags: review?(mdeboer) → review+
We have a comprehensive test suite, so when it's green, I'd be comfortably with landing this.
(In reply to Mike de Boer [:mikedeboer] from comment #8) > I see what you did here, but please try to use `hg mv` to make the diff > smaller (the content-sessionStore.js deletions will be omitted in that > case). r=me with that change! Unfortunately, that doesn't work. `hg mv` just registers a copy and a delete. Re-adding the original file in the same commit just undoes the delete, and you get the same diff you'd get with just a `cp`.
It looks like I missed something here, because tests are failing - I assume you're on it?
(In reply to Mike de Boer [:mikedeboer] from comment #11) > It looks like I missed something here, because tests are failing - I assume > you're on it? Yeah, sorry, I forgot to change `onLoadStarted() {` to `onLoadStarted: () => {` in restoreHistory. Already fixed.
(I also apparently made a classic Vim-user error and changed this.contentRestoreInitialized to this.ontentRestoreInitialized just before committing... which broke a bunch of things that worked when I first tested :/)
https://hg.mozilla.org/integration/mozilla-inbound/rev/d5106a0c2566570158dfaf129ad42a4ff811c158 Bug 1474139: Part 1 - Refactor content-sessionSstore to not depend on running in a frame script global. r=mikedeboer https://hg.mozilla.org/integration/mozilla-inbound/rev/ccfb086c668d4454ee4484dc1d22951e9a3bc6c3 Bug 1474139: Part 2 - Move content-sessionStore to a separate JSM. r=mikedeboer
(In reply to Kris Maglione [:kmag] from comment #15) > (I also apparently made a classic Vim-user error and changed > this.contentRestoreInitialized to this.ontentRestoreInitialized just before > committing... which broke a bunch of things that worked when I first tested > :/) Heh, and I focused my review on logical errors, not typos ;-) It seems to have all worked out - fingers crossed of course, but usually our unit tests give a very good indication. Thanks!
https://hg.mozilla.org/integration/mozilla-inbound/rev/1a8131b3319381ef00054af0de6ce6d811552ad8 Bug 1474139: Follow-up: Fix test that relied on Timer.jsm being implicitly imported. r=bustage,test-only CLOSED TREE
https://hg.mozilla.org/integration/mozilla-inbound/rev/835430ce6d62e9ce56ceaca7b0a7ba8ae1f6830f Bug 1474139: Follow-up: Fix another test that relied on Timer.jsm being implicitly imported. r=bustage CLOSED TREE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: