Commit 1d7e84e1 authored by Hiroki Nakagawa's avatar Hiroki Nakagawa Committed by Commit Bot

PlzWorker: Rename SharedWorkerScript* to WorkerScript*

To make browser-side loader classes for PlzSharedWorker reusable for
PlzDedicatedWorker, this CL renames the classes as follows:

- SharedWorkerScriptFetcher => WorkerScriptFetcher
- SharedWorkerScriptLoader => WorkerScriptLoader
- SharedWorkerScriptLoaderFactory => WorkerScriptLoaderFactory
- SharedWorkerMainScriptLoadParams => WorkerMainScriptLoadParams

This doesn't change functional behavior.

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

Bug: 906991
Change-Id: If25f463655f2f53a533a6c1504f57f05937860a1
Reviewed-on: https://chromium-review.googlesource.com/c/1350018Reviewed-by: default avatarChristian Dullweber <dullweber@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarMatt Falkenhagen <falken@chromium.org>
Commit-Queue: Hiroki Nakagawa <nhiroki@chromium.org>
Cr-Commit-Position: refs/heads/master@{#611084}
parent d4a0ec5f
......@@ -1700,16 +1700,16 @@ jumbo_source_set("browser") {
"shared_worker/shared_worker_host.h",
"shared_worker/shared_worker_instance.cc",
"shared_worker/shared_worker_instance.h",
"shared_worker/shared_worker_script_fetcher.cc",
"shared_worker/shared_worker_script_fetcher.h",
"shared_worker/shared_worker_script_loader.cc",
"shared_worker/shared_worker_script_loader.h",
"shared_worker/shared_worker_script_loader_factory.cc",
"shared_worker/shared_worker_script_loader_factory.h",
"shared_worker/shared_worker_service_impl.cc",
"shared_worker/shared_worker_service_impl.h",
"shared_worker/worker_script_fetch_initiator.cc",
"shared_worker/worker_script_fetch_initiator.h",
"shared_worker/worker_script_fetcher.cc",
"shared_worker/worker_script_fetcher.h",
"shared_worker/worker_script_loader.cc",
"shared_worker/worker_script_loader.h",
"shared_worker/worker_script_loader_factory.cc",
"shared_worker/worker_script_loader_factory.h",
"site_instance_impl.cc",
"site_instance_impl.h",
"speech/speech_recognition_dispatcher_host.cc",
......
......@@ -107,7 +107,7 @@ void MockSharedWorkerFactory::CreateSharedWorker(
int appcache_host_id,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_sciript_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
mojom::ControllerServiceWorkerInfoPtr controller_info,
mojom::SharedWorkerHostPtr host,
......
......@@ -76,7 +76,7 @@ class MockSharedWorkerFactory : public mojom::SharedWorkerFactory {
int appcache_host_id,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
mojom::ControllerServiceWorkerInfoPtr controller_info,
mojom::SharedWorkerHostPtr host,
......
......@@ -145,7 +145,7 @@ void SharedWorkerHost::Start(
service_worker_provider_info,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
base::Optional<SubresourceLoaderParams> subresource_loader_params) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
......
......@@ -25,7 +25,7 @@
#include "mojo/public/cpp/bindings/binding.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "services/service_manager/public/mojom/interface_provider.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/web/devtools_agent.mojom.h"
class GURL;
......@@ -95,7 +95,7 @@ class CONTENT_EXPORT SharedWorkerHost
service_worker_provider_info,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
base::Optional<SubresourceLoaderParams> subresource_loader_params);
......
......@@ -76,7 +76,7 @@ class SharedWorkerHostTest : public testing::Test {
mojom::ServiceWorkerProviderInfoForSharedWorkerPtr provider_info = nullptr;
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory;
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params;
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params;
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories;
base::Optional<SubresourceLoaderParams> subresource_loader_params;
......@@ -88,8 +88,7 @@ class SharedWorkerHostTest : public testing::Test {
helper_->context()->AsWeakPtr(), mock_render_process_host_.GetID(),
&provider_info);
main_script_load_params =
blink::mojom::SharedWorkerMainScriptLoadParams::New();
main_script_load_params = blink::mojom::WorkerMainScriptLoadParams::New();
subresource_loader_factories.reset(new URLLoaderFactoryBundleInfo());
subresource_loader_params = SubresourceLoaderParams();
......
......@@ -242,7 +242,7 @@ void SharedWorkerServiceImpl::DidCreateScriptLoader(
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
base::Optional<SubresourceLoaderParams> subresource_loader_params,
bool success) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
......@@ -277,7 +277,7 @@ void SharedWorkerServiceImpl::StartWorker(
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
base::Optional<SubresourceLoaderParams> subresource_loader_params) {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
......
......@@ -20,7 +20,7 @@
#include "content/public/browser/shared_worker_service.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/worker_main_script_load_params.mojom.h"
namespace blink {
class MessagePortChannel;
......@@ -92,7 +92,7 @@ class CONTENT_EXPORT SharedWorkerServiceImpl : public SharedWorkerService {
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
base::Optional<SubresourceLoaderParams> subresource_loader_params,
bool success);
void StartWorker(
......@@ -107,7 +107,7 @@ class CONTENT_EXPORT SharedWorkerServiceImpl : public SharedWorkerService {
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
base::Optional<SubresourceLoaderParams> subresource_loader_params);
// Returns nullptr if there is no such host.
......
......@@ -15,9 +15,9 @@
#include "content/browser/appcache/appcache_navigation_handle_core.h"
#include "content/browser/file_url_loader_factory.h"
#include "content/browser/service_worker/service_worker_context_wrapper.h"
#include "content/browser/shared_worker/shared_worker_script_fetcher.h"
#include "content/browser/shared_worker/shared_worker_script_loader.h"
#include "content/browser/shared_worker/shared_worker_script_loader_factory.h"
#include "content/browser/shared_worker/worker_script_fetcher.h"
#include "content/browser/shared_worker/worker_script_loader.h"
#include "content/browser/shared_worker/worker_script_loader_factory.h"
#include "content/browser/storage_partition_impl.h"
#include "content/browser/url_loader_factory_getter.h"
#include "content/browser/web_contents/web_contents_impl.h"
......@@ -65,7 +65,7 @@ void WorkerScriptFetchInitiator::Start(
// Set up the factory bundle for non-NetworkService URLs, e.g.,
// chrome-extension:// URLs. One factory bundle is consumed by the browser
// for SharedWorkerScriptLoaderFactory, and one is sent to the renderer for
// for WorkerScriptLoaderFactory, and one is sent to the renderer for
// subresource loading.
std::unique_ptr<URLLoaderFactoryBundleInfo> factory_bundle_for_browser =
CreateFactoryBundle(process_id, storage_partition,
......@@ -233,8 +233,8 @@ void WorkerScriptFetchInitiator::CreateScriptLoaderOnIO(
base::WeakPtr<ServiceWorkerProviderHost> host =
context->PreCreateHostForSharedWorker(process_id, &provider_info);
// Create the URL loader factory for SharedWorkerScriptLoaderFactory to use to
// load the main script.
// Create the URL loader factory for WorkerScriptLoaderFactory to use to load
// the main script.
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory;
if (blob_url_loader_factory_info) {
// If we have a blob_url_loader_factory just use that directly rather than
......@@ -284,8 +284,8 @@ void WorkerScriptFetchInitiator::CreateScriptLoaderOnIO(
*resource_request, context->resource_context(), wc_getter,
nullptr /* navigation_ui_data */, -1 /* frame_tree_node_id */);
SharedWorkerScriptFetcher::CreateAndStart(
std::make_unique<SharedWorkerScriptLoaderFactory>(
WorkerScriptFetcher::CreateAndStart(
std::make_unique<WorkerScriptLoaderFactory>(
process_id, host, std::move(appcache_host),
context->resource_context(), std::move(url_loader_factory)),
std::move(throttles), std::move(resource_request),
......@@ -296,10 +296,10 @@ void WorkerScriptFetchInitiator::CreateScriptLoaderOnIO(
return;
}
// Create the SharedWorkerScriptLoaderFactory.
// Create the WorkerScriptLoaderFactory.
network::mojom::URLLoaderFactoryAssociatedPtrInfo main_script_loader_factory;
mojo::MakeStrongAssociatedBinding(
std::make_unique<SharedWorkerScriptLoaderFactory>(
std::make_unique<WorkerScriptLoaderFactory>(
process_id, host->AsWeakPtr(), std::move(appcache_host),
context->resource_context(), std::move(url_loader_factory)),
mojo::MakeRequest(&main_script_loader_factory));
......@@ -319,7 +319,7 @@ void WorkerScriptFetchInitiator::DidCreateScriptLoaderOnIO(
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
base::Optional<SubresourceLoaderParams> subresource_loader_params,
bool success) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
......
......@@ -12,12 +12,11 @@
#include "base/compiler_specific.h"
#include "base/macros.h"
#include "content/common/service_worker/service_worker_provider.mojom.h"
#include "content/public/browser/shared_worker_service.h"
#include "content/public/common/resource_type.h"
#include "content/public/common/url_loader_throttle.h"
#include "services/network/public/cpp/resource_response.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/worker_main_script_load_params.mojom.h"
namespace network {
class SharedURLLoaderFactory;
......@@ -36,14 +35,14 @@ struct SubresourceLoaderParams;
// PlzWorker:
// WorkerScriptFetchInitiator is the entry point of browser-side script fetch
// for SharedWorkerScriptFetcher.
// for WorkerScriptFetcher.
class WorkerScriptFetchInitiator {
public:
using CompletionCallback = base::OnceCallback<void(
mojom::ServiceWorkerProviderInfoForSharedWorkerPtr,
network::mojom::URLLoaderFactoryAssociatedPtrInfo,
std::unique_ptr<URLLoaderFactoryBundleInfo>,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr,
blink::mojom::WorkerMainScriptLoadParamsPtr,
base::Optional<SubresourceLoaderParams>,
bool)>;
......@@ -87,7 +86,7 @@ class WorkerScriptFetchInitiator {
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
base::Optional<SubresourceLoaderParams> subresource_loader_params,
bool success);
};
......
......@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/shared_worker/shared_worker_script_fetcher.h"
#include "content/browser/shared_worker/worker_script_fetcher.h"
#include "base/feature_list.h"
#include "content/browser/shared_worker/shared_worker_script_loader.h"
#include "content/browser/shared_worker/shared_worker_script_loader_factory.h"
#include "content/browser/shared_worker/worker_script_loader.h"
#include "content/browser/shared_worker/worker_script_loader_factory.h"
#include "content/common/throttling_url_loader.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/common/url_loader_throttle.h"
......@@ -18,16 +18,15 @@ namespace content {
namespace {
const net::NetworkTrafficAnnotationTag
kSharedWorkerScriptLoadTrafficAnnotation =
net::DefineNetworkTrafficAnnotation("shared_worker_script_load",
R"(
const net::NetworkTrafficAnnotationTag kWorkerScriptLoadTrafficAnnotation =
net::DefineNetworkTrafficAnnotation("worker_script_load",
R"(
semantics {
sender: "Shared Worker Script Load"
sender: "Web Worker Script Load"
description:
"This request is issued by SharedWorker to fetch its main script."
"This request is issued by Web Worker to fetch its main script."
trigger:
"Calling new SharedWorker()."
"Calling new Worker() or SharedWorker()."
data: "Anything the initiator wants to send."
destination: OTHER
}
......@@ -50,22 +49,21 @@ const net::NetworkTrafficAnnotationTag
} // namespace
void SharedWorkerScriptFetcher::CreateAndStart(
std::unique_ptr<SharedWorkerScriptLoaderFactory> script_loader_factory,
void WorkerScriptFetcher::CreateAndStart(
std::unique_ptr<WorkerScriptLoaderFactory> script_loader_factory,
std::vector<std::unique_ptr<URLLoaderThrottle>> throttles,
std::unique_ptr<network::ResourceRequest> resource_request,
CreateAndStartCallback callback) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(base::FeatureList::IsEnabled(network::features::kNetworkService));
// This fetcher will delete itself. See the class level comment.
(new SharedWorkerScriptFetcher(std::move(script_loader_factory),
std::move(resource_request),
std::move(callback)))
(new WorkerScriptFetcher(std::move(script_loader_factory),
std::move(resource_request), std::move(callback)))
->Start(std::move(throttles));
}
SharedWorkerScriptFetcher::SharedWorkerScriptFetcher(
std::unique_ptr<SharedWorkerScriptLoaderFactory> script_loader_factory,
WorkerScriptFetcher::WorkerScriptFetcher(
std::unique_ptr<WorkerScriptLoaderFactory> script_loader_factory,
std::unique_ptr<network::ResourceRequest> resource_request,
CreateAndStartCallback callback)
: script_loader_factory_(std::move(script_loader_factory)),
......@@ -75,11 +73,11 @@ SharedWorkerScriptFetcher::SharedWorkerScriptFetcher(
DCHECK_CURRENTLY_ON(BrowserThread::IO);
}
SharedWorkerScriptFetcher::~SharedWorkerScriptFetcher() {
WorkerScriptFetcher::~WorkerScriptFetcher() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
}
void SharedWorkerScriptFetcher::Start(
void WorkerScriptFetcher::Start(
std::vector<std::unique_ptr<URLLoaderThrottle>> throttles) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
......@@ -88,6 +86,8 @@ void SharedWorkerScriptFetcher::Start(
script_loader_factory_.get());
// SharedWorker doesn't have a frame.
// TODO(nhiroki): Make the caller pass the frame id to support dedicated
// workers (https://crbug.com/906991).
int32_t routing_id = MSG_ROUTING_NONE;
// NetworkService is not interested in the request ID.
......@@ -96,15 +96,15 @@ void SharedWorkerScriptFetcher::Start(
url_loader_ = ThrottlingURLLoader::CreateLoaderAndStart(
std::move(shared_url_loader_factory), std::move(throttles), routing_id,
request_id, network::mojom::kURLLoadOptionNone, resource_request_.get(),
this, kSharedWorkerScriptLoadTrafficAnnotation,
this, kWorkerScriptLoadTrafficAnnotation,
base::ThreadTaskRunnerHandle::Get());
}
void SharedWorkerScriptFetcher::OnReceiveResponse(
void WorkerScriptFetcher::OnReceiveResponse(
const network::ResourceResponseHead& head) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
base::WeakPtr<SharedWorkerScriptLoader> script_loader =
base::WeakPtr<WorkerScriptLoader> script_loader =
script_loader_factory_->GetScriptLoader();
if (script_loader && script_loader->default_loader_used_) {
// If the default network loader was used to handle the URL load request we
......@@ -124,10 +124,10 @@ void SharedWorkerScriptFetcher::OnReceiveResponse(
}
}
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params =
blink::mojom::SharedWorkerMainScriptLoadParams::New();
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params =
blink::mojom::WorkerMainScriptLoadParams::New();
// Fill in params for loading shared worker's main script and subresources.
// Fill in params for loading worker's main script and subresources.
main_script_load_params->response_head = head;
if (url_loader_) {
// The main script was served by a request interceptor or the default
......@@ -160,7 +160,7 @@ void SharedWorkerScriptFetcher::OnReceiveResponse(
delete this;
}
void SharedWorkerScriptFetcher::OnReceiveRedirect(
void WorkerScriptFetcher::OnReceiveRedirect(
const net::RedirectInfo& redirect_info,
const network::ResourceResponseHead& head) {
redirect_infos_.push_back(redirect_info);
......@@ -168,31 +168,29 @@ void SharedWorkerScriptFetcher::OnReceiveRedirect(
url_loader_->FollowRedirect(base::nullopt);
}
void SharedWorkerScriptFetcher::OnUploadProgress(
int64_t current_position,
int64_t total_size,
OnUploadProgressCallback callback) {
void WorkerScriptFetcher::OnUploadProgress(int64_t current_position,
int64_t total_size,
OnUploadProgressCallback callback) {
NOTREACHED();
}
void SharedWorkerScriptFetcher::OnReceiveCachedMetadata(
void WorkerScriptFetcher::OnReceiveCachedMetadata(
const std::vector<uint8_t>& data) {
NOTREACHED();
}
void SharedWorkerScriptFetcher::OnTransferSizeUpdated(
int32_t transfer_size_diff) {
void WorkerScriptFetcher::OnTransferSizeUpdated(int32_t transfer_size_diff) {
NOTREACHED();
}
void SharedWorkerScriptFetcher::OnStartLoadingResponseBody(
void WorkerScriptFetcher::OnStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle body) {
// Not reached. At this point, the loader and client endpoints must have
// been unbound and forwarded to the renderer.
NOTREACHED();
}
void SharedWorkerScriptFetcher::OnComplete(
void WorkerScriptFetcher::OnComplete(
const network::URLLoaderCompletionStatus& status) {
// We can reach here only when loading fails before receiving a response head.
DCHECK_NE(net::OK, status.error_code);
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_FETCHER_H_
#define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_FETCHER_H_
#ifndef CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_FETCHER_H_
#define CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_FETCHER_H_
#include "base/callback.h"
#include "base/optional.h"
......@@ -12,7 +12,7 @@
#include "net/url_request/redirect_info.h"
#include "services/network/public/cpp/weak_wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/worker_main_script_load_params.mojom.h"
namespace network {
struct ResourceResponseHead;
......@@ -21,40 +21,40 @@ struct ResourceRequest;
namespace content {
class SharedWorkerScriptLoaderFactory;
class ThrottlingURLLoader;
class URLLoaderThrottle;
class WorkerScriptLoaderFactory;
// NetworkService (PlzWorker):
// This is an implementation of the URLLoaderClient for shared worker's main
// script fetch. The loader and client bounded with this class are to be unbound
// and forwarded to the renderer process on OnReceiveResponse, and the resource
// This is an implementation of the URLLoaderClient for web worker's main script
// fetch. The loader and client bounded with this class are to be unbound and
// forwarded to the renderer process on OnReceiveResponse, and the resource
// loader in the renderer process will take them over.
//
// SharedWorkerScriptFetcher deletes itself when the ownership of the loader and
// WorkerScriptFetcher deletes itself when the ownership of the loader and
// client is passed to the renderer, or on failure. It lives on the IO thread.
class SharedWorkerScriptFetcher : public network::mojom::URLLoaderClient {
class WorkerScriptFetcher : public network::mojom::URLLoaderClient {
public:
using CreateAndStartCallback =
base::OnceCallback<void(blink::mojom::SharedWorkerMainScriptLoadParamsPtr,
base::OnceCallback<void(blink::mojom::WorkerMainScriptLoadParamsPtr,
base::Optional<SubresourceLoaderParams>,
bool /* success */)>;
// Called on the IO thread, and calls |callback| on the IO thread when
// OnReceiveResponse is called on |this|.
static void CreateAndStart(
std::unique_ptr<SharedWorkerScriptLoaderFactory> script_loader_factory,
std::unique_ptr<WorkerScriptLoaderFactory> script_loader_factory,
std::vector<std::unique_ptr<URLLoaderThrottle>> throttles,
std::unique_ptr<network::ResourceRequest> resource_request,
CreateAndStartCallback callback);
private:
SharedWorkerScriptFetcher(
std::unique_ptr<SharedWorkerScriptLoaderFactory> script_loader_factory,
WorkerScriptFetcher(
std::unique_ptr<WorkerScriptLoaderFactory> script_loader_factory,
std::unique_ptr<network::ResourceRequest> resource_request,
CreateAndStartCallback callback);
~SharedWorkerScriptFetcher() override;
~WorkerScriptFetcher() override;
void Start(std::vector<std::unique_ptr<URLLoaderThrottle>> throttles);
......@@ -71,7 +71,7 @@ class SharedWorkerScriptFetcher : public network::mojom::URLLoaderClient {
mojo::ScopedDataPipeConsumerHandle body) override;
void OnComplete(const network::URLLoaderCompletionStatus& status) override;
std::unique_ptr<SharedWorkerScriptLoaderFactory> script_loader_factory_;
std::unique_ptr<WorkerScriptLoaderFactory> script_loader_factory_;
std::unique_ptr<network::ResourceRequest> resource_request_;
CreateAndStartCallback callback_;
......@@ -94,4 +94,4 @@ class SharedWorkerScriptFetcher : public network::mojom::URLLoaderClient {
} // namespace content
#endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_FETCHER_H_
#endif // CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_FETCHER_H_
......@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/shared_worker/shared_worker_script_loader.h"
#include "content/browser/shared_worker/worker_script_loader.h"
#include "content/browser/appcache/appcache_request_handler.h"
#include "content/browser/loader/navigation_loader_interceptor.h"
......@@ -15,7 +15,7 @@
namespace content {
SharedWorkerScriptLoader::SharedWorkerScriptLoader(
WorkerScriptLoader::WorkerScriptLoader(
int process_id,
int32_t routing_id,
int32_t request_id,
......@@ -60,20 +60,20 @@ SharedWorkerScriptLoader::SharedWorkerScriptLoader(
Start();
}
SharedWorkerScriptLoader::~SharedWorkerScriptLoader() = default;
WorkerScriptLoader::~WorkerScriptLoader() = default;
base::WeakPtr<SharedWorkerScriptLoader> SharedWorkerScriptLoader::GetWeakPtr() {
base::WeakPtr<WorkerScriptLoader> WorkerScriptLoader::GetWeakPtr() {
return weak_factory_.GetWeakPtr();
}
void SharedWorkerScriptLoader::Start() {
void WorkerScriptLoader::Start() {
if (interceptor_index_ < interceptors_.size()) {
auto* interceptor = interceptors_[interceptor_index_++].get();
interceptor->MaybeCreateLoader(
resource_request_, resource_context_,
base::BindOnce(&SharedWorkerScriptLoader::MaybeStartLoader,
base::BindOnce(&WorkerScriptLoader::MaybeStartLoader,
weak_factory_.GetWeakPtr(), interceptor),
base::BindOnce(&SharedWorkerScriptLoader::LoadFromNetwork,
base::BindOnce(&WorkerScriptLoader::LoadFromNetwork,
weak_factory_.GetWeakPtr()));
return;
}
......@@ -81,7 +81,7 @@ void SharedWorkerScriptLoader::Start() {
LoadFromNetwork(false);
}
void SharedWorkerScriptLoader::MaybeStartLoader(
void WorkerScriptLoader::MaybeStartLoader(
NavigationLoaderInterceptor* interceptor,
SingleRequestURLLoaderFactory::RequestHandler single_request_handler) {
DCHECK(interceptor);
......@@ -115,8 +115,7 @@ void SharedWorkerScriptLoader::MaybeStartLoader(
Start();
}
void SharedWorkerScriptLoader::LoadFromNetwork(
bool reset_subresource_loader_params) {
void WorkerScriptLoader::LoadFromNetwork(bool reset_subresource_loader_params) {
default_loader_used_ = true;
network::mojom::URLLoaderClientPtr client;
if (url_loader_client_binding_)
......@@ -133,7 +132,7 @@ void SharedWorkerScriptLoader::LoadFromNetwork(
// When this class gets a FollowRedirect IPC from the renderer, it restarts with
// the new URL.
void SharedWorkerScriptLoader::FollowRedirect(
void WorkerScriptLoader::FollowRedirect(
const base::Optional<std::vector<std::string>>&
to_be_removed_request_headers,
const base::Optional<net::HttpRequestHeaders>& modified_request_headers,
......@@ -172,7 +171,7 @@ void SharedWorkerScriptLoader::FollowRedirect(
Start();
}
void SharedWorkerScriptLoader::ProceedWithResponse() {
void WorkerScriptLoader::ProceedWithResponse() {
// Only for navigations.
NOTREACHED();
}
......@@ -180,18 +179,18 @@ void SharedWorkerScriptLoader::ProceedWithResponse() {
// Below we make a small effort to support the other URLLoader functions by
// forwarding to the current |url_loader_| if any, but don't bother queuing
// state or propagating state to a new URLLoader upon redirect.
void SharedWorkerScriptLoader::SetPriority(net::RequestPriority priority,
int32_t intra_priority_value) {
void WorkerScriptLoader::SetPriority(net::RequestPriority priority,
int32_t intra_priority_value) {
if (url_loader_)
url_loader_->SetPriority(priority, intra_priority_value);
}
void SharedWorkerScriptLoader::PauseReadingBodyFromNet() {
void WorkerScriptLoader::PauseReadingBodyFromNet() {
if (url_loader_)
url_loader_->PauseReadingBodyFromNet();
}
void SharedWorkerScriptLoader::ResumeReadingBodyFromNet() {
void WorkerScriptLoader::ResumeReadingBodyFromNet() {
if (url_loader_)
url_loader_->ResumeReadingBodyFromNet();
}
......@@ -201,12 +200,12 @@ void SharedWorkerScriptLoader::ResumeReadingBodyFromNet() {
// Additionally, on redirects it saves the redirect info so if the renderer
// calls FollowRedirect(), it can do so.
void SharedWorkerScriptLoader::OnReceiveResponse(
void WorkerScriptLoader::OnReceiveResponse(
const network::ResourceResponseHead& response_head) {
client_->OnReceiveResponse(response_head);
}
void SharedWorkerScriptLoader::OnReceiveRedirect(
void WorkerScriptLoader::OnReceiveRedirect(
const net::RedirectInfo& redirect_info,
const network::ResourceResponseHead& response_head) {
if (--redirect_limit_ == 0) {
......@@ -219,7 +218,7 @@ void SharedWorkerScriptLoader::OnReceiveRedirect(
client_->OnReceiveRedirect(redirect_info, response_head);
}
void SharedWorkerScriptLoader::OnUploadProgress(
void WorkerScriptLoader::OnUploadProgress(
int64_t current_position,
int64_t total_size,
OnUploadProgressCallback ack_callback) {
......@@ -227,40 +226,38 @@ void SharedWorkerScriptLoader::OnUploadProgress(
std::move(ack_callback));
}
void SharedWorkerScriptLoader::OnReceiveCachedMetadata(
void WorkerScriptLoader::OnReceiveCachedMetadata(
const std::vector<uint8_t>& data) {
client_->OnReceiveCachedMetadata(data);
}
void SharedWorkerScriptLoader::OnTransferSizeUpdated(
int32_t transfer_size_diff) {
void WorkerScriptLoader::OnTransferSizeUpdated(int32_t transfer_size_diff) {
client_->OnTransferSizeUpdated(transfer_size_diff);
}
void SharedWorkerScriptLoader::OnStartLoadingResponseBody(
void WorkerScriptLoader::OnStartLoadingResponseBody(
mojo::ScopedDataPipeConsumerHandle consumer) {
client_->OnStartLoadingResponseBody(std::move(consumer));
}
void SharedWorkerScriptLoader::OnComplete(
void WorkerScriptLoader::OnComplete(
const network::URLLoaderCompletionStatus& status) {
if (status.error_code == net::OK)
service_worker_provider_host_->CompleteSharedWorkerPreparation();
client_->OnComplete(status);
}
bool SharedWorkerScriptLoader::MaybeCreateLoaderForResponse(
bool WorkerScriptLoader::MaybeCreateLoaderForResponse(
const network::ResourceResponseHead& response,
network::mojom::URLLoaderPtr* response_url_loader,
network::mojom::URLLoaderClientRequest* response_client_request,
ThrottlingURLLoader* url_loader) {
// TODO(crbug/898755): This is odd that NavigationLoaderInterceptor::
// MaybeCreateLoader() is called directly from SharedWorkerScriptLoader. But
// MaybeCreateLoader() is called directly from WorkerScriptLoader. But
// NavigationLoaderInterceptor::MaybeCreateLoaderForResponse() is called from
// SharedWorkerScriptFetcher::OnReceiveResponse(). This is due to the wired
// design of SharedWorkerScriptLoader and SharedWorkerScriptFetcher and the
// interceptors. The interceptors should be owned by
// SharedWorkerScriptFetcher.
// WorkerScriptFetcher::OnReceiveResponse(). This is due to the wired design
// of WorkerScriptLoader and WorkerScriptFetcher and the interceptors. The
// interceptors should be owned by WorkerScriptFetcher.
DCHECK(default_loader_used_);
for (auto& interceptor : interceptors_) {
bool skip_other_interceptors = false;
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_LOADER_H_
#define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_LOADER_H_
#ifndef CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_LOADER_H_
#define CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_LOADER_H_
#include "base/macros.h"
#include "content/common/navigation_subresource_loader_params.h"
......@@ -36,15 +36,15 @@ class ServiceWorkerProviderHost;
// starting a new loader and becoming the client of that.
//
// Lives on the IO thread.
class SharedWorkerScriptLoader : public network::mojom::URLLoader,
public network::mojom::URLLoaderClient {
class WorkerScriptLoader : public network::mojom::URLLoader,
public network::mojom::URLLoaderClient {
public:
// |default_loader_factory| is used to load the script if the load is not
// intercepted by a feature like service worker. Typically it will load the
// script from the NetworkService. However, it may internally contain
// non-NetworkService factories used for non-http(s) URLs, e.g., a
// chrome-extension:// URL.
SharedWorkerScriptLoader(
WorkerScriptLoader(
int process_id,
int32_t routing_id,
int32_t request_id,
......@@ -56,7 +56,7 @@ class SharedWorkerScriptLoader : public network::mojom::URLLoader,
ResourceContext* resource_context,
scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation);
~SharedWorkerScriptLoader() override;
~WorkerScriptLoader() override;
// network::mojom::URLLoader:
void FollowRedirect(
......@@ -98,7 +98,7 @@ class SharedWorkerScriptLoader : public network::mojom::URLLoader,
return std::move(subresource_loader_params_);
}
base::WeakPtr<SharedWorkerScriptLoader> GetWeakPtr();
base::WeakPtr<WorkerScriptLoader> GetWeakPtr();
// Set to true if the default URLLoader (network service) was used for the
// current request.
......@@ -139,10 +139,10 @@ class SharedWorkerScriptLoader : public network::mojom::URLLoader,
// elect to handle the request.
scoped_refptr<network::SharedURLLoaderFactory> url_loader_factory_;
base::WeakPtrFactory<SharedWorkerScriptLoader> weak_factory_;
base::WeakPtrFactory<WorkerScriptLoader> weak_factory_;
DISALLOW_COPY_AND_ASSIGN(SharedWorkerScriptLoader);
DISALLOW_COPY_AND_ASSIGN(WorkerScriptLoader);
};
} // namespace content
#endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_LOADER_H_
#endif // CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_LOADER_H_
......@@ -2,14 +2,14 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "content/browser/shared_worker/shared_worker_script_loader_factory.h"
#include "content/browser/shared_worker/worker_script_loader_factory.h"
#include <memory>
#include "base/feature_list.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_provider_host.h"
#include "content/browser/service_worker/service_worker_version.h"
#include "content/browser/shared_worker/shared_worker_script_loader.h"
#include "content/browser/shared_worker/worker_script_loader.h"
#include "content/public/browser/browser_thread.h"
#include "mojo/public/cpp/bindings/strong_binding.h"
#include "services/network/public/cpp/features.h"
......@@ -20,7 +20,7 @@
namespace content {
SharedWorkerScriptLoaderFactory::SharedWorkerScriptLoaderFactory(
WorkerScriptLoaderFactory::WorkerScriptLoaderFactory(
int process_id,
base::WeakPtr<ServiceWorkerProviderHost> service_worker_provider_host,
base::WeakPtr<AppCacheHost> appcache_host,
......@@ -37,11 +37,11 @@ SharedWorkerScriptLoaderFactory::SharedWorkerScriptLoaderFactory(
blink::mojom::ServiceWorkerProviderType::kForSharedWorker);
}
SharedWorkerScriptLoaderFactory::~SharedWorkerScriptLoaderFactory() {
WorkerScriptLoaderFactory::~WorkerScriptLoaderFactory() {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
}
void SharedWorkerScriptLoaderFactory::CreateLoaderAndStart(
void WorkerScriptLoaderFactory::CreateLoaderAndStart(
network::mojom::URLLoaderRequest request,
int32_t routing_id,
int32_t request_id,
......@@ -56,23 +56,24 @@ void SharedWorkerScriptLoaderFactory::CreateLoaderAndStart(
if (!base::FeatureList::IsEnabled(network::features::kNetworkService)) {
// Handle only the main script (RESOURCE_TYPE_SHARED_WORKER). Import scripts
// should go to the network loader or controller.
// TODO(nhiroki): Support dedicated workers (https://crbug.com/906991).
if (resource_request.resource_type != RESOURCE_TYPE_SHARED_WORKER) {
mojo::ReportBadMessage(
"SharedWorkerScriptLoaderFactory should only get requests for shared "
"worker scripts");
"WorkerScriptLoaderFactory should only get requests for worker "
"scripts");
return;
}
if (script_loader_) {
mojo::ReportBadMessage(
"SharedWorkerScriptLoaderFactory should be used only one time");
"WorkerScriptLoaderFactory should be used only one time");
return;
}
}
DCHECK_EQ(RESOURCE_TYPE_SHARED_WORKER, resource_request.resource_type);
DCHECK(!script_loader_);
// Create a SharedWorkerScriptLoader to load the script.
auto script_loader = std::make_unique<SharedWorkerScriptLoader>(
// Create a WorkerScriptLoader to load the script.
auto script_loader = std::make_unique<WorkerScriptLoader>(
process_id_, routing_id, request_id, options, resource_request,
std::move(client), service_worker_provider_host_, appcache_host_,
resource_context_, loader_factory_, traffic_annotation);
......@@ -80,7 +81,7 @@ void SharedWorkerScriptLoaderFactory::CreateLoaderAndStart(
mojo::MakeStrongBinding(std::move(script_loader), std::move(request));
}
void SharedWorkerScriptLoaderFactory::Clone(
void WorkerScriptLoaderFactory::Clone(
network::mojom::URLLoaderFactoryRequest request) {
// This method is required to support synchronous requests, which shared
// worker script requests are not.
......
......@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_LOADER_FACTORY_H_
#define CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_LOADER_FACTORY_H_
#ifndef CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_LOADER_FACTORY_H_
#define CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_LOADER_FACTORY_H_
#include "base/macros.h"
#include "content/common/navigation_subresource_loader_params.h"
......@@ -17,34 +17,33 @@ namespace content {
class AppCacheHost;
class ServiceWorkerProviderHost;
class SharedWorkerScriptLoader;
class ResourceContext;
class WorkerScriptLoader;
// S13nServiceWorker:
// Created per one running shared worker for loading its script.
// Created per one running web worker for loading its script.
//
// Shared worker script loads require special logic because they are similiar to
// navigations from the point of view of web platform features like service
// worker.
//
// This creates a SharedWorkerScriptLoader to load the script, which follows
// redirects and sets the controller service worker on the shared worker if
// needed. It's an error to call CreateLoaderAndStart() more than a total of one
// time across this object or any of its clones.
class SharedWorkerScriptLoaderFactory
: public network::mojom::URLLoaderFactory {
// This creates a WorkerScriptLoader to load the script, which follows redirects
// and sets the controller service worker on the web worker if needed. It's an
// error to call CreateLoaderAndStart() more than a total of one time across
// this object or any of its clones.
class WorkerScriptLoaderFactory : public network::mojom::URLLoaderFactory {
public:
// |loader_factory| is used to load the script if the load is not intercepted
// by a feature like service worker. Typically it will load the script from
// the NetworkService. However, it may internally contain non-NetworkService
// factories used for non-http(s) URLs, e.g., a chrome-extension:// URL.
SharedWorkerScriptLoaderFactory(
WorkerScriptLoaderFactory(
int process_id,
base::WeakPtr<ServiceWorkerProviderHost> provider_host,
base::WeakPtr<AppCacheHost> appcache_host,
ResourceContext* resource_context,
scoped_refptr<network::SharedURLLoaderFactory> loader_factory);
~SharedWorkerScriptLoaderFactory() override;
~WorkerScriptLoaderFactory() override;
// network::mojom::URLLoaderFactory:
void CreateLoaderAndStart(network::mojom::URLLoaderRequest request,
......@@ -57,9 +56,7 @@ class SharedWorkerScriptLoaderFactory
traffic_annotation) override;
void Clone(network::mojom::URLLoaderFactoryRequest request) override;
base::WeakPtr<SharedWorkerScriptLoader> GetScriptLoader() {
return script_loader_;
}
base::WeakPtr<WorkerScriptLoader> GetScriptLoader() { return script_loader_; }
private:
const int process_id_;
......@@ -70,11 +67,11 @@ class SharedWorkerScriptLoaderFactory
// This is owned by StrongBinding associated with the given URLLoaderRequest,
// and invalidated after request completion or failure.
base::WeakPtr<SharedWorkerScriptLoader> script_loader_;
base::WeakPtr<WorkerScriptLoader> script_loader_;
DISALLOW_COPY_AND_ASSIGN(SharedWorkerScriptLoaderFactory);
DISALLOW_COPY_AND_ASSIGN(WorkerScriptLoaderFactory);
};
} // namespace content
#endif // CONTENT_BROWSER_SHARED_WORKER_SHARED_WORKER_SCRIPT_LOADER_FACTORY_H_
#endif // CONTENT_BROWSER_SHARED_WORKER_WORKER_SCRIPT_LOADER_FACTORY_H_
......@@ -15,7 +15,7 @@ import "content/public/common/renderer_preferences.mojom";
import "mojo/public/mojom/base/unguessable_token.mojom";
import "services/network/public/mojom/url_loader_factory.mojom";
import "services/service_manager/public/mojom/interface_provider.mojom";
import "third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom";
import "third_party/blink/public/mojom/shared_worker/worker_main_script_load_params.mojom";
import "third_party/blink/public/web/worker_content_settings_proxy.mojom";
// The name of the InterfaceProviderSpec in service manifests used by the
......@@ -70,7 +70,7 @@ interface SharedWorkerFactory {
// NetworkService (PlzWorker):
// Used for passing a main script pre-requested by the browser process and
// its redirect information.
blink.mojom.SharedWorkerMainScriptLoadParams? main_script_load_params,
blink.mojom.WorkerMainScriptLoadParams? main_script_load_params,
// NetworkService:
// When the Network Service is enabled, |subresource_loader_factories|
......
......@@ -218,7 +218,7 @@ EmbeddedSharedWorkerStub::EmbeddedSharedWorkerStub(
int appcache_host_id,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> factory_bundle,
mojom::ControllerServiceWorkerInfoPtr controller_info,
mojom::SharedWorkerHostPtr host,
......
......@@ -20,7 +20,7 @@
#include "mojo/public/cpp/bindings/binding.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "services/service_manager/public/mojom/interface_provider.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/shared_worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/mojom/shared_worker/worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/platform/web_content_security_policy.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/public/platform/web_string.h"
......@@ -71,7 +71,7 @@ class EmbeddedSharedWorkerStub : public blink::WebSharedWorkerClient,
int appcache_host_id,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
mojom::ControllerServiceWorkerInfoPtr controller_info,
mojom::SharedWorkerHostPtr host,
......
......@@ -32,7 +32,7 @@ void SharedWorkerFactoryImpl::CreateSharedWorker(
int appcache_host_id,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
mojom::ControllerServiceWorkerInfoPtr controller_info,
mojom::SharedWorkerHostPtr host,
......
......@@ -33,7 +33,7 @@ class SharedWorkerFactoryImpl : public mojom::SharedWorkerFactory {
int appcache_host_id,
network::mojom::URLLoaderFactoryAssociatedPtrInfo
main_script_loader_factory,
blink::mojom::SharedWorkerMainScriptLoadParamsPtr main_script_load_params,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<URLLoaderFactoryBundleInfo> subresource_loader_factories,
mojom::ControllerServiceWorkerInfoPtr controller_info,
mojom::SharedWorkerHostPtr host,
......
......@@ -61,7 +61,7 @@ mojom("mojom_platform") {
"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",
"shared_worker/worker_main_script_load_params.mojom",
"speech/speech_recognition_error.mojom",
"speech/speech_recognition_grammar.mojom",
"speech/speech_recognition_result.mojom",
......
......@@ -7,9 +7,9 @@ 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
// Used for passing the web worker main script pre-requested by the browser
// process and its redirect information.
struct SharedWorkerMainScriptLoadParams {
struct WorkerMainScriptLoadParams {
// Used for loading the pre-requested main script in the renderer process.
network.mojom.URLResponseHead response_head;
network.mojom.URLLoaderClientEndpoints? url_loader_client_endpoints;
......
......@@ -238,7 +238,6 @@ Refer to README.md for content description and update process.
<item id="service_worker_update_checker" hash_code="130931413" type="0" content_hash_code="46608086" os_list="linux,windows" file_path="content/browser/service_worker/service_worker_single_script_update_checker.cc"/>
<item id="service_worker_write_to_cache_job" hash_code="117963307" type="0" content_hash_code="18065724" os_list="linux,windows" file_path="content/browser/service_worker/service_worker_write_to_cache_job.cc"/>
<item id="services_http_server_error_response" hash_code="59302801" type="0" content_hash_code="127774041" os_list="linux,windows" file_path="services/network/public/cpp/server/http_server.cc"/>
<item id="shared_worker_script_load" hash_code="107347227" type="0" content_hash_code="64293499" os_list="linux,windows" file_path="content/browser/shared_worker/shared_worker_script_fetcher.cc"/>
<item id="sigined_exchange_cert_fetcher" hash_code="79442849" type="0" content_hash_code="8138156" os_list="linux,windows" file_path="content/browser/web_package/signed_exchange_cert_fetcher.cc"/>
<item id="signed_in_profile_avatar" hash_code="108903331" type="0" content_hash_code="72850619" os_list="linux,windows" file_path="chrome/browser/profiles/profile_downloader.cc"/>
<item id="socket_bio_adapter" hash_code="516551" type="0" content_hash_code="21643352" os_list="linux,windows" file_path="net/socket/socket_bio_adapter.cc"/>
......@@ -287,5 +286,6 @@ Refer to README.md for content description and update process.
<item id="webstore_install_helper" hash_code="25921771" type="0" content_hash_code="10206361" os_list="linux,windows" file_path="chrome/browser/extensions/webstore_install_helper.cc"/>
<item id="webstore_installer" hash_code="18764319" type="0" content_hash_code="11030110" os_list="linux,windows" file_path="chrome/browser/extensions/webstore_installer.cc"/>
<item id="webui_content_scripts_download" hash_code="100545943" type="0" content_hash_code="119898059" os_list="linux,windows" file_path="extensions/browser/guest_view/web_view/web_ui/web_ui_url_fetcher.cc"/>
<item id="worker_script_load" hash_code="72087791" type="0" content_hash_code="24889169" os_list="linux,windows" file_path="content/browser/shared_worker/worker_script_fetcher.cc"/>
<item id="xmpp_signal_strategy" hash_code="88906454" type="0" content_hash_code="88958321" os_list="linux,windows" file_path="remoting/signaling/xmpp_signal_strategy.cc"/>
</annotations>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment