PlzWorker: Initiate top-level worker script loading for Shared Workers from the browser process

This CL adds SharedWorkerScriptFetcher that initiates a top-level worker script
loading for shared workers from the browser process. Once the fetcher receives a
response head, that unbounds the URL loader and its client, and passes them to
the renderer process with the StartWorker message. In the renderer process,
WorkerClassicScriptLoader in Blink makes a resource request as usual, and
ResourceDispatcher in Content serves it using the passed URLLoader etc.

In addition, this CL makes Shared Workers run with AppCache on NetworkService,
AppCache's fallback case is not implemented yet though. Subsequent CLs will
implement the case.

See the design doc for more details:
https://docs.google.com/document/d/1Jtn33bvqkqWxq6K7HIA4uU6HLWPTmOD7vFviacfTmhM/edit?usp=sharing

Bug: 715632
Change-Id: I7aafd2224dec42a89a274a9b1820ae9775535aca
Cq-Include-Trybots: luci.chromium.try:linux_mojo
Reviewed-on: https://chromium-review.googlesource.com/1154743
Commit-Queue: Hiroki Nakagawa <[email protected]>
Reviewed-by: Mike West <[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@{#588495}
diff --git a/third_party/blink/public/mojom/BUILD.gn b/third_party/blink/public/mojom/BUILD.gn
index e3f0d9e8..af2b5f63 100644
--- a/third_party/blink/public/mojom/BUILD.gn
+++ b/third_party/blink/public/mojom/BUILD.gn
@@ -56,6 +56,7 @@
     "service_worker/service_worker_state.mojom",
     "service_worker/service_worker_stream_handle.mojom",
     "shared_worker/shared_worker_creation_context_type.mojom",
+    "shared_worker/shared_worker_main_script_load_params.mojom",
     "speech/speech_recognition_error.mojom",
     "speech/speech_recognition_grammar.mojom",
     "speech/speech_recognition_result.mojom",
diff --git a/third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom b/third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom
new file mode 100644
index 0000000..22e5f0b
--- /dev/null
+++ b/third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom
@@ -0,0 +1,23 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+module blink.mojom;
+
+import "services/network/public/mojom/url_loader.mojom";
+
+// NetworkService (PlzWorker):
+// Used for passing the shared worker main script pre-requested by the browser
+// process and its redirect information.
+struct SharedWorkerMainScriptLoadParams {
+  // Used for loading the pre-requested main script in the renderer process.
+  network.mojom.URLResponseHead response_head;
+  network.mojom.URLLoaderClientEndpoints? url_loader_client_endpoints;
+
+  // The list of redirects that led to this script load. Empty if there were no
+  // redirects.
+  array<network.mojom.URLRequestRedirectInfo> redirect_infos;
+
+  // The list of redirect response heads. Empty if there were no redirects.
+  array<network.mojom.URLResponseHead> redirect_response_heads;
+};