[ServiceWorker] Pass SW provider info via navigation commit IPC

For a navigation,
previously,
  - browser: precreate a provider host.
  - browser: send the provider id via navigation commit IPC.
  - renderer: create a provider for the provider id above.
  - renderer: call ServiceWorkerDispatcherHost.OnProviderCreated(),
    which carries ServiceWorkerContainer(Host) Mojo connections to help
    the browser-side provider host complete its initialization.

now,
  - browser: precreate a provider host with ServiceWorkerContainer(Host)
    Mojo connections created, its lifetime is tied to the
    ServiceWorkerContainerHost Mojo connection.
  - browser: send the provider info (id, ServiceWorkerContainer(Host)
    Mojo connections) via navigation commit IPC.
  - renderer: create a provider based on the provider info above.
  - renderer: call ServiceWorkerContainerHost.OnProviderCreated() to
    notify the browser-side provider host.

This simplifies lifetime management of ServiceWorkerProviderHost, it's
tied to ServiceWorkerContainerHost Mojo connection from the point it's
born.

Also, after this CL, ServiceWorkerDispatcherHost becomes totally
useless, a follow-up CL will remove it.

BUG=931092

Change-Id: Ie6e8e574d6e6aad27e8ee0920c95ae7ce76e1317
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1490770
Commit-Queue: Matt Falkenhagen <[email protected]>
Reviewed-by: Kinuko Yasuda <[email protected]>
Reviewed-by: Makoto Shimazu <[email protected]>
Reviewed-by: Matt Falkenhagen <[email protected]>
Cr-Commit-Position: refs/heads/master@{#640151}
diff --git a/content/common/frame.mojom b/content/common/frame.mojom
index 3d32af40..79182c0 100644
--- a/content/common/frame.mojom
+++ b/content/common/frame.mojom
@@ -28,6 +28,7 @@
 import "third_party/blink/public/mojom/portal/portal.mojom";
 import "third_party/blink/public/mojom/referrer.mojom";
 import "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom";
+import "third_party/blink/public/mojom/service_worker/service_worker_provider.mojom";
 import "third_party/blink/public/web/commit_result.mojom";
 import "third_party/blink/public/mojom/devtools/devtools_agent.mojom";
 import "third_party/blink/public/mojom/portal/portal.mojom";
@@ -100,6 +101,8 @@
   // |controller_service_worker_info| may also be provided by the browser if the
   // frame that is being navigated is supposed to be controlled by a Service
   // Worker.
+  // |provider_info| may also be provided if the browser has created a
+  // ServiceWorkerProviderHost for this navigation.
   // |prefetch_loader_factory| is populated only when Network Service is
   // enabled. The pointer is used to start a prefetch loading via the browser
   // process.
@@ -122,6 +125,7 @@
       blink.mojom.URLLoaderFactoryBundle? subresource_loader_factories,
       array<TransferrableURLLoader>? subresource_overrides,
       blink.mojom.ControllerServiceWorkerInfo? controller_service_worker_info,
+      blink.mojom.ServiceWorkerProviderInfoForWindow? provider_info,
       network.mojom.URLLoaderFactory? prefetch_loader_factory,
       mojo_base.mojom.UnguessableToken devtools_navigation_token)
       => (blink.mojom.CommitResult commit_result);