Closed Bug 1728326 Opened 3 years ago Closed 3 years ago

Notify to the WebExtensions internals when extension background service workers are being spawned or terminated

Categories

(WebExtensions :: General, task, P1)

task

Tracking

(firefox96 fixed)

RESOLVED FIXED
96 Branch
Tracking Status
firefox96 --- fixed

People

(Reporter: rpl, Assigned: rpl)

References

(Blocks 1 open bug)

Details

(Whiteboard: [mv3-m2])

Attachments

(10 files)

(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details
(deleted), text/x-phabricator-request
Details

As a follow up to Bug 1688040, the WebExtensions internals running in the extension process should be notified when an extension background service workers are being spawned or terminated, similarly to how we are being notified for the extension windows being created and destroyed.

Attachment #9239708 - Attachment description: WIP: Bug 1728326 - Notify extension-worker-destroy topic when a WebExtensions background service worker is destroyed. r?asuth! → Bug 1728326 - Notify extension-worker-destroy topic when a WebExtensions background service worker is destroyed. r?asuth!
Attachment #9239709 - Attachment description: WIP: Bug 1728326 - Add ServiceWorkerInfo descriptor id to mozIExtensionServiceWorkerInfo. r?baku! → Bug 1728326 - Add ServiceWorkerInfo descriptor id to mozIExtensionServiceWorkerInfo. r?baku!
Attachment #9239710 - Attachment description: WIP: Bug 1728326 - Add an INIT_WORKER_CONTEXT request type to be sent when the WebExtensions background worker script is about to be executed. r?baku! → Bug 1728326 - Add an INIT_WORKER_CONTEXT request type to be sent when the WebExtensions background worker script is about to be executed. r?baku!
Attachment #9239711 - Attachment description: WIP: Bug 1728326 - Notify WebExtensions internals when the background service worker is ready to be executed. r?asuth! → Bug 1728326 - Notify WebExtensions internals when the background service worker is ready to be executed. r?asuth!
Attachment #9239712 - Attachment description: WIP: Bug 1728326 - Notify extension-worker-loaded topic when a WebExtensions background service worker scripts has been executed. r?asuth! → Bug 1728326 - Notify extension-worker-loaded topic when a WebExtensions background service worker scripts has been executed. r?asuth!
Attachment #9239713 - Attachment description: WIP: Bug 1728326 - Add GetRegistrationForAddonPrincipal to nsIServiceWorkerManager. r?asuth! → Bug 1728326 - Add GetRegistrationForAddonPrincipal to nsIServiceWorkerManager. r?asuth!
Attachment #9239714 - Attachment description: WIP: Bug 1728326 - Create ExtensionWorkerChild on API request with requestType INIT_WORKER_CONTEXT and destroy it on extension-worker-destroy topic. r?zombie! → Bug 1728326 - Create ExtensionWorkerChild on API request with requestType INIT_WORKER_CONTEXT and destroy it on extension-worker-destroy topic. r?zombie!
Attachment #9239715 - Attachment description: WIP: Bug 1728326 - Notify main process when the extension background service worker has been fully loaded. r?zombie! → Bug 1728326 - Notify main process when the extension background service worker has been fully loaded. r?zombie!
Attachment #9239708 - Attachment description: Bug 1728326 - Notify extension-worker-destroy topic when a WebExtensions background service worker is destroyed. r?asuth! → Bug 1728326 - Notify WebExtensions internals when a WebExtensions background service worker is destroyed. r?asuth!
Attachment #9239710 - Attachment description: Bug 1728326 - Add an INIT_WORKER_CONTEXT request type to be sent when the WebExtensions background worker script is about to be executed. r?baku! → Bug 1728326 - Add a new RequestInitWorkerRunnable that call mozIExtensionAPIRequestHandler initExtensionWorker. r?baku!
Attachment #9239712 - Attachment description: Bug 1728326 - Notify extension-worker-loaded topic when a WebExtensions background service worker scripts has been executed. r?asuth! → Bug 1728326 - Notify WebExtensions internals when a background service worker scripts has been executed. r?asuth!
Attachment #9239714 - Attachment description: Bug 1728326 - Create ExtensionWorkerChild on API request with requestType INIT_WORKER_CONTEXT and destroy it on extension-worker-destroy topic. r?zombie! → Bug 1728326 - Create ExtensionWorkerChild once on ExtensionAPIRequestHandler.initExtensionWorker and destroy it on ExtensionAPIRequestHandler.onExtensionWorkerDestroyed. r?zombie!
Attachment #9239710 - Attachment description: Bug 1728326 - Add a new RequestInitWorkerRunnable that call mozIExtensionAPIRequestHandler initExtensionWorker. r?baku! → Bug 1728326 - Add a new RequestInitWorkerRunnable to call mozIExtensionAPIRequestHandler initExtensionWorker. r?baku!
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/ebf25d0924d6 Notify WebExtensions internals when a WebExtensions background service worker is destroyed. r=asuth https://hg.mozilla.org/integration/autoland/rev/de8879fc8126 Add ServiceWorkerInfo descriptor id to mozIExtensionServiceWorkerInfo. r=baku https://hg.mozilla.org/integration/autoland/rev/247504b7ea84 Add a new RequestInitWorkerRunnable to call mozIExtensionAPIRequestHandler initExtensionWorker. r=baku https://hg.mozilla.org/integration/autoland/rev/5c8d87c04ac6 Notify WebExtensions internals when the background service worker is ready to be executed. r=asuth https://hg.mozilla.org/integration/autoland/rev/fd700124d69b Notify WebExtensions internals when a background service worker scripts has been executed. r=asuth https://hg.mozilla.org/integration/autoland/rev/4ca5e36e3c71 Add GetRegistrationForAddonPrincipal to nsIServiceWorkerManager. r=asuth https://hg.mozilla.org/integration/autoland/rev/d21475767077 Create ExtensionWorkerChild once on ExtensionAPIRequestHandler.initExtensionWorker and destroy it on ExtensionAPIRequestHandler.onExtensionWorkerDestroyed. r=zombie https://hg.mozilla.org/integration/autoland/rev/f06e0af1bf81 Notify main process when the extension background service worker has been fully loaded. r=zombie https://hg.mozilla.org/integration/autoland/rev/070f187c2005 Introduce BackgroundWorkerContextParent and verify worker descriptor id is part of the extension worker registration. r=zombie https://hg.mozilla.org/integration/autoland/rev/39267f23ee63 Rename internal WebExtensions events related to the background script (from background-page into background-script). r=zombie

Backed out 10 changesets (Bug 1728326) for causing build bustages.
Backout link
Push with failures
Failure Log

Flags: needinfo?(lgreco)

My apologies, I actually fixed that same debug build failure in a couple of the patches attached to this bug but apparently D124701 was missing one that I had locally.

And so my push to try was successfully completing the debug build, but the ones pushed from Lando could not without that trivial change my push to try already had.

I just updated D124701 (along with updating also the other ones that were likely already updated, just in case I missed another one), and will push to autoland again shortly.

Flags: needinfo?(lgreco)
Pushed by luca.greco@alcacoop.it: https://hg.mozilla.org/integration/autoland/rev/0b0479a00c80 Notify WebExtensions internals when a WebExtensions background service worker is destroyed. r=asuth https://hg.mozilla.org/integration/autoland/rev/cc488a5fabad Add ServiceWorkerInfo descriptor id to mozIExtensionServiceWorkerInfo. r=baku https://hg.mozilla.org/integration/autoland/rev/afb346a9eb0a Add a new RequestInitWorkerRunnable to call mozIExtensionAPIRequestHandler initExtensionWorker. r=baku https://hg.mozilla.org/integration/autoland/rev/e5db0d655a19 Notify WebExtensions internals when the background service worker is ready to be executed. r=asuth https://hg.mozilla.org/integration/autoland/rev/83e0401fe863 Notify WebExtensions internals when a background service worker scripts has been executed. r=asuth https://hg.mozilla.org/integration/autoland/rev/29639f9f4696 Add GetRegistrationForAddonPrincipal to nsIServiceWorkerManager. r=asuth https://hg.mozilla.org/integration/autoland/rev/61f6df514baf Create ExtensionWorkerChild once on ExtensionAPIRequestHandler.initExtensionWorker and destroy it on ExtensionAPIRequestHandler.onExtensionWorkerDestroyed. r=zombie https://hg.mozilla.org/integration/autoland/rev/73e1ee1385ed Notify main process when the extension background service worker has been fully loaded. r=zombie https://hg.mozilla.org/integration/autoland/rev/1201687418dc Introduce BackgroundWorkerContextParent and verify worker descriptor id is part of the extension worker registration. r=zombie https://hg.mozilla.org/integration/autoland/rev/eed6f4952eb0 Rename internal WebExtensions events related to the background script (from background-page into background-script). r=zombie
Regressions: 1739797
Regressions: 1739799
Regressions: 1739806
No longer regressions: 1739799
No longer regressions: 1739806
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: