Closed Bug 1827665 Opened 8 months ago Closed 7 months ago

Introduce an ExtensionProcessCrashObserver singleton in the WebExtensions internals


(WebExtensions :: General, task)



(firefox114 fixed)

114 Branch
Tracking Status
firefox114 --- fixed


(Reporter: rpl, Assigned: rpl)


(Blocks 1 open bug)


(Whiteboard: [addons-jira])


(1 file)

As part of introducing extension process crash detection and handling, especially in support of enabling the extension child process in GeckoView builds where the child extension process has an higher chance to be forcefully killed by the operating system, we want to introduce a new ExtensionProcessCrashObserver singleton, which will have the role of:

  • observing the observer service topics notified when a new extension child process is created (or a preallocated child process allocated to be used as a new extension child process) and when the extension child process is shutdown
  • detecting an abnormal extension child process shutdown
  • emitting an internal WebExtensions global event (one for all extensions) when an abnormal extension child process shutdown has been detected

In separate patches built on top of the one introducing the ExtensionProcessCrashObserver we expect to be wiring it up:

  • with a GeckoView singleton that would notify the embedder when an extension child process chat have been hit (currently tracked by Bug 1819737)
  • with code handling the extension process crash from a background page/event page perspective (currently tracked by Bug 1819732)

This patch includes:

  • a new ExtensionProcessCrashObserver singleton in Extension.jsm, which is responsible
    for watching extension process allocation and shutdown and emit an internal
    Management event when a new extension child process crash has been detected.
  • a new browser_ext_process_crash_handling.js test file that covers ExtensionProcessCrashObserver
    behaviors with explicit automated tests.

The Management event is meant to be listened by:

  • ext-backgroundPage.js, to handle the process crash by cleaning up the background context state from
    the backgroundStatus it was when it did hit a crash.
  • by a GeckoView singleton that will be notify the GeckoView embedder about new extension process
    crashes detected
Assignee: nobody → lgreco
Blocks: 1830157
Pushed by
Introduce a new ExtensionProcessCrashObserver singleton. r=willdurand,amejiamarmol
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 114 Branch
Blocks: 1844138
Blocks: 1845523
See Also: → 1845352
See Also: → 1847608
No longer blocks: 1844138
You need to log in before you can comment on or make changes to this bug.