service worker: Keep precreated provider hosts in the same process map.
ServiceWorkerContextCore owns provider hosts, and stores them in a map from <process id, provider id> to host. But precreated hosts are created before the process id is known. So the hosts are first stored in <-1, provider id> before being moved to <process id, provider id>. That complicates adding a Mojo error connection handler to the host, which tries to call RemoveProviderHost(process_id, provider_id). Fortunately, precreated hosts have a unique provider id anyway, so the process id isn't needed. This CL makes it so precreated hosts always live in <-1, provider id>, so a Mojo error connection handler can be added to them immediately. Note that we can't easily make renderer-assigned provider ids unique since they are generated by each renderer process on its own. But eventually the renderer-created providers will go away anyway, since they aren't used since PlzNavigate except for non-S13nServiceWorker shared worker. Some more design at: https://docs.google.com/document/d/1FDaAwQ9O1Z2am1XEMPiEsVzWXgqCkT1ZqpVlcGmBve4/edit This will allow fixing the linked bug, by the next CL: https://chromium-review.googlesource.com/c/chromium/src/+/1159544 Bug: 854993 Change-Id: I3f638496e0e7436e484c956531709ff6931418ff Reviewed-on: https://chromium-review.googlesource.com/1159542 Commit-Queue: Matt Falkenhagen <falken@chromium.org> Reviewed-by:Makoto Shimazu <shimazu@chromium.org> Reviewed-by:
Hiroki Nakagawa <nhiroki@chromium.org> Reviewed-by:
Kenichi Ishibashi <bashi@chromium.org> Cr-Commit-Position: refs/heads/master@{#580102}
Showing
Please register or sign in to comment