Closed Bug 1484373 Opened Last year Closed Last year

Move more content-side framework logic to C++

Categories

(WebExtensions :: General, enhancement)

enhancement
Not set

Tracking

(firefox63 fixed)

RESOLVED FIXED
mozilla63
Tracking Status
firefox63 --- fixed

People

(Reporter: kmag, Assigned: kmag)

References

(Blocks 1 open bug)

Details

(Whiteboard: [overhead:40k])

Attachments

(14 files)

46 bytes, text/x-phabricator-request
smaug
: review+
Details | Review
46 bytes, text/x-phabricator-request
smaug
: review+
Details | Review
46 bytes, text/x-phabricator-request
froydnj
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
mixedpuppy
: review+
Details | Review
46 bytes, text/x-phabricator-request
froydnj
: review+
Details | Review
46 bytes, text/x-phabricator-request
smaug
: review+
Details | Review
The base part of the extension framework that we load into every content process currently takes up at least 70K, despite our efforts to minimize the amount of the framework that we load by default.

A big chunk of this is MessageChannel.jsm, which will eventually be replaced by IPDL actors, so I'm going to ignore this for now.

The other big chunk is extension-process-script.js. A lot of the logic for this already lives in the C++ ExtensionPolicyService service and WebExtensionPolicy instances. It shouldn't be hard to move more of it there.
This makes it easier to add promise handlers from C++ in a manner similar to
JavaScript.
Whiteboard: [overhead:40k] → [overhead:30k]
Comment on attachment 9002214 [details]
Bug 1484373: Part 1 - Allow querying to ContentFrameMessageManager. r=smaug

Olli Pettay [:smaug] has approved the revision.
Attachment #9002214 - Flags: review+
It's currently fairly difficult to perform some operation on each member of a
tuple. This is a particular issue in the context of adding a cycle collection
helper, where we need to perform traverse and unlink operations on each member
of a tuple, and don't have a way to do so without several layers of templates.

This patch adds a ForEach function which will call a function on each element
of the tuple. This would typically be used with a lambda function with a
single `auto&` argument.
Attachment #9002215 - Attachment description: Bug 1484373: Part 2 - Add Promise::Then handler which accepts a lambda. r=smaug → Bug 1484373: Part 2c - Add Promise::Then handler which accepts a lambda. r=smaug
Comment on attachment 9002218 [details]
Bug 1484373: Part 5 - Minimize the amount of content script options processing we do in child processes r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002218 - Flags: review+
Comment on attachment 9002220 [details]
Bug 1484373: Part 7 - Minimize duplicated code in process script message handler. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002220 - Flags: review+
Comment on attachment 9002221 [details]
Bug 1484373: Part 8 - Use generateSingletonFactory for process script singleton. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002221 - Flags: review+
Comment on attachment 9002224 [details]
Bug 1484373: Part 11 - Fold mostly-empty DocumentManager singleton into ExtensionManager. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002224 - Flags: review+
Comment on attachment 9002225 [details]
Bug 1484373: Part 12 - Use policy object rather than keeping serialized extension data alive. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002225 - Flags: review+
Comment on attachment 9002216 [details]
Bug 1484373: Part 3 - Add ranged iterator wrapper for nsISimpleEnumerator. r?froydnj

Nathan Froyd [:froydnj] has approved the revision.
Attachment #9002216 - Flags: review+
Comment on attachment 9002339 [details]
Bug 1484373: Part 2a - Add Tuple ForEach helper function. r=froydnj

Nathan Froyd [:froydnj] has approved the revision.
Attachment #9002339 - Flags: review+
Comment on attachment 9002217 [details]
Bug 1484373: Part 4 - Move more content script injection logic into policy service. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002217 - Flags: review+
Comment on attachment 9002219 [details]
Bug 1484373: Part 6 - Minimize the amount of JS processing required to init extension policies. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002219 - Flags: review+
Comment on attachment 9002222 [details]
Bug 1484373: Part 9 - Move more extension page matching logic into policy service. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002222 - Flags: review+
Comment on attachment 9002223 [details]
Bug 1484373: Part 10 - Move some receiveMessage code to ExtensionContent.jsm. r=mixedpuppy

Shane Caraveo (:mixedpuppy) has approved the revision.
Attachment #9002223 - Flags: review+
Comment on attachment 9002340 [details]
Bug 1484373: Part 2b - Add cycle collection helpers for Tuple types. r=smaug

Olli Pettay [:smaug] has approved the revision.
Attachment #9002340 - Flags: review+
Comment on attachment 9002215 [details]
Bug 1484373: Part 2c - Add Promise::Then handler which accepts a lambda. r=smaug

Olli Pettay [:smaug] has approved the revision.
Attachment #9002215 - Flags: review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/ddba7fcc0d3b5493f7039d5dd61a77d647cb03f3
Bug 1484373: Part 1 - Allow querying to ContentFrameMessageManager. r=smaug

https://hg.mozilla.org/integration/mozilla-inbound/rev/70b72c8bddc6dd189bf6cbc79828b790e032af3e
Bug 1484373: Part 2a - Add Tuple ForEach helper function. r=froydnj

https://hg.mozilla.org/integration/mozilla-inbound/rev/13e34da7e745043689e2bda3adbc889b25782f71
Bug 1484373: Part 2b - Add cycle collection helpers for Tuple types. r=smaug

https://hg.mozilla.org/integration/mozilla-inbound/rev/721d186ac3c3ecdf7a8e3fb1a2f4b6052d56e725
Bug 1484373: Part 2c - Add Promise::Then handler which accepts a lambda. r=smaug

https://hg.mozilla.org/integration/mozilla-inbound/rev/010feaaca7deeddb0ae13e5e899988af089ae241
Bug 1484373: Part 3 - Add ranged iterator wrapper for nsISimpleEnumerator. r=froydnj

https://hg.mozilla.org/integration/mozilla-inbound/rev/a7848dcb339e399ee108590e413a548dfea4a1c3
Bug 1484373: Part 4 - Move more content script injection logic into policy service. r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/03cdd81e991d9675c5166e39a825b99fabded292
Bug 1484373: Part 5 - Minimize the amount of content script options processing we do in child processes r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/4cc1736698ad36957e04996a5b087f6f1e5bad88
Bug 1484373: Part 6 - Minimize the amount of JS processing required to init extension policies. r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/0ac474b385990059335e48c03445e662172bc4d0
Bug 1484373: Part 7 - Minimize duplicated code in process script message handler. r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/1b774e058f1d93b737c4d37f4061e7e2f0449ff8
Bug 1484373: Part 8 - Use generateSingletonFactory for process script singleton. r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/63c64335cec03809578607164b12ab6b067a52d2
Bug 1484373: Part 9 - Move more extension page matching logic into policy service. r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/091835164b689bd673182068ab7c896cba203449
Bug 1484373: Part 10 - Move some receiveMessage code to ExtensionContent.jsm. r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/812ae71cea4f9c4971a6ef2b40b64eb26ba1feeb
Bug 1484373: Part 11 - Fold mostly-empty DocumentManager singleton into ExtensionManager. r=mixedpuppy

https://hg.mozilla.org/integration/mozilla-inbound/rev/b88f5fa7dca4ba5cb92d9c905f3e52d043977498
Bug 1484373: Part 12 - Use policy object rather than keeping serialized extension data alive. r=mixedpuppy
Whiteboard: [overhead:30k] → [overhead:40k]
https://hg.mozilla.org/integration/mozilla-inbound/rev/602fa2f2e75da226a632f65700c9a1db8baf89ae
Bug 1484373: Follow-up: Work around a new race in browser_webext_options. r=bustage
Depends on: 1486057
Depends on: 1486168
Depends on: 1486199
Can you please some STRs to this issue(and a test webextension if possible) or mark it as "qe-verify-" ?
Flags: needinfo?(kmaglione+bmo)
Flags: needinfo?(kmaglione+bmo) → qe-verify-
Depends on: 1486101
You need to log in before you can comment on or make changes to this bug.