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.
Whiteboard: [e10s-multi:M1] → [e10s-multi:M3]
I'm going to do this as a follow-on to my Client infrastructure work.
Assignee: amarchesini → bkelly
Depends on: 1293277
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.
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.
I think I'm going to treat this as a meta-bug.
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
You need to log in before you can comment on or make changes to this bug.