Currently, ServiceManager has the following ownership model for per-user services:
A per-user service (Service B) is owned by the first service to connect to it (Service A). If Service A dies, Service B is killed as well.
This parent-child relationship makes sense in some contexts but does not in others, e.g., suppose Service B is a service connected to by all renderers: it will die when the first renderer to connect to it is killed, even if there are other renderers that still need it to be alive. For more details on this use case, see this chromium-mojo@ thread:
https://groups.google.com/a/chromium.org/forum/#!topic/chromium-mojo/41Bhbnk6CY0
We will eliminate this default ownership model and instead have the following:
- By default, services will be completely responsible for their own lifetime.
- A service can specify that it is a "session manager" in its manifest. Such a service will own all the services that it directly or transitively connects to.
- We will use this "session manager" attribute to keep the current behavior in cases where it is desired.
Comment 1 by bugdroid1@chromium.org
, Dec 15 2016