remove child process pointers like nsIDocument from ServiceWorkerManager

ASSIGNED
Assigned to

Status

()

Core
DOM: Service Workers
P2
normal
ASSIGNED
3 years ago
4 months ago

People

(Reporter: bkelly, Assigned: bkelly)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [e10s-multi:M3])

(Assignee)

Description

3 years ago
Currently service worker manager directly references nsIDocument in many places.  This needs to be abstracted to a client interface so we can deal with clients in a remote process.  It also lets us handle clients that are not documents, like workers.

Updated

2 years ago
Assignee: nobody → ehsan
Assignee: ehsan → amarchesini
Whiteboard: [e10s-multi:M1]
Whiteboard: [e10s-multi:M1] → [e10s-multi:M3]
(Assignee)

Comment 1

a year ago
I'm going to do this as a follow-on to my Client infrastructure work.
Assignee: amarchesini → bkelly
Depends on: 1293277
(Assignee)

Updated

a year ago
Status: NEW → ASSIGNED
(Assignee)

Comment 2

a year ago
Note to self:  Test document.open() behavior on a page that is controlled by a service worker.  The spec suggests we should stop being controlled.  We probably get this for free by controlling documents, but it could be easily regressed if we shift to controlling nsGlobalWindow.
(Assignee)

Comment 3

5 months ago
Bug 1293277 is close to completion.  I plan to start this next.  My current thought is to find all uses of nsIDocument and replace them with ClientHandle.

I expect to have to implement two new features in ClientHandle:

1. A console reporting mechanism that sends the message to the ClientSource to report.  This is necessary for the various "ReportToAll*()" methods in SWM.  At first I thought perhaps I could just expose the windowId and report locally, but that doesn't work for all clients.  For example, a SharedWorker ClientSource probably will want to send the console report to all owning document windows, etc.

2. A callback or MozPromise mechanism to find out when a ClientHandle's IPC is detached.  This will allow the ServiceWorkerManager to know when all the controlled clients are gone and the active worker can move to redundant.

Note, even after this change we will still have ServiceWorkerManager in the child processes.  These changes are not sufficient to move the parent process.  To complete the move we will still need:

a. IPC-backed implementations of DOM objects like ServiceWorker, ServiceWorkerRegistration, and ServiceWorkerContainer.
b. Necko integration that supports parent-side SWM in some way.  Ideally this is interception in the parent, but we may have to do an IPC mechanism at first.
(Assignee)

Comment 4

5 months ago
I think I'm going to treat this as a meta-bug.
(Assignee)

Updated

5 months ago
Depends on: 1425316
(Assignee)

Updated

5 months ago
Depends on: 1425965
(Assignee)

Updated

5 months ago
Depends on: 1425975
(Assignee)

Updated

5 months ago
Depends on: 1426253
(Assignee)

Comment 5

4 months ago
Morphing this into a meta more about removing more child process interface pointers from ServiceWorkerManager.
Summary: replace nsIDocument in service worker manager with a client interface → remove child process pointers like nsIDocument from ServiceWorkerManager
(Assignee)

Updated

4 months ago
Depends on: 1231211

Updated

4 months ago
Priority: -- → P2
You need to log in before you can comment on or make changes to this bug.