Closed Bug 1460047 Opened 6 years ago Closed 6 years ago

Support delay-loading of modules on startup

Categories

(GeckoView :: General, enhancement, P3)

All
Android
enhancement

Tracking

(firefox62 fixed)

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: jchen, Assigned: jchen)

References

Details

Attachments

(3 files)

Delay load some modules that are not used until they're enabled.
Priority: -- → P3
Comment on attachment 8974177 [details]
Bug 1460047 - 1. Assign module resource to phases;

https://reviewboard.mozilla.org/r/242474/#review248576

That's nice! Let's make sure to track the perf win with this landing.

::: mobile/android/chrome/geckoview/geckoview.js:136
(Diff revision 1)
>   * modules. It is responsible for loading the module JSM file if necessary,
>   * and it acts as the intermediary between ModuleManager and the module
>   * object that extends GeckoViewModule.
>   */
>  class ModuleInfo {
> -  constructor({enabled, manager, name, resource}) {
> +  constructor({manager, name, enabled, onInit, onEnable}) {

Please add comments.

::: mobile/android/chrome/geckoview/geckoview.js:154
(Diff revision 1)
>    onInit() {
>      this._impl.onInit();
>      this.enabled = this._enabledOnInit;
>    }
>  
> +  _loadPhase(aPhase) {

Please add comments.
Attachment #8974177 - Flags: review?(esawin) → review+
Comment on attachment 8974178 [details]
Bug 1460047 - 2. Add frame script support to ModuleManager;

https://reviewboard.mozilla.org/r/242476/#review248600

We used to have modules and content modules, which were loaded as frame scripts, with a 1:1 (or 1:0) relationship - the naming scheme was consistent about that.
With this patch we rename content modules to frame scripts, which is more generic and removes the GV-specific relationship.

I'm not sure I like that, is there a reason for that?
Comment on attachment 8974179 [details]
Bug 1460047 - 3. Make module resource optional;

https://reviewboard.mozilla.org/r/242478/#review248620
Attachment #8974179 - Flags: review?(esawin) → review+
Comment on attachment 8974178 [details]
Bug 1460047 - 2. Add frame script support to ModuleManager;

https://reviewboard.mozilla.org/r/242476/#review248600

Not really. I can change to content. Do you think we should use "frameScript" as the name of the property that specifis the frame script URL to load?
(In reply to Jim Chen [:jchen] [:darchons] from comment #7)
> Not really. I can change to content. Do you think we should use
> "frameScript" as the name of the property that specifis the frame script URL
> to load?

I think "frameScript" makes sense in this context, so does "resource".
Comment on attachment 8974178 [details]
Bug 1460047 - 2. Add frame script support to ModuleManager;

https://reviewboard.mozilla.org/r/242476/#review249574
Attachment #8974178 - Flags: review?(esawin) → review+
Pushed by nchen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/da7d2ac6100f
1. Assign module resource to phases; r=esawin
https://hg.mozilla.org/integration/autoland/rev/91e14caab7a8
2. Add frame script support to ModuleManager; r=esawin
https://hg.mozilla.org/integration/autoland/rev/699cb2e4fdc1
3. Make module resource optional; r=esawin
Product: Firefox for Android → GeckoView
Target Milestone: Firefox 62 → mozilla62
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: