#include "content/renderer/worker/dedicated_worker_host_factory_client.h"
#include <utility>
#include "base/ranges/algorithm.h"
#include "base/task/single_thread_task_runner.h"
#include "content/renderer/render_thread_impl.h"
#include "content/renderer/service_worker/service_worker_provider_context.h"
#include "content/renderer/worker/fetch_client_settings_object_helpers.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "net/storage_access_api/status.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/worker_main_script_load_parameters.h"
#include "third_party/blink/public/common/tokens/tokens.h"
#include "third_party/blink/public/common/tokens/tokens_mojom_traits.h"
#include "third_party/blink/public/mojom/blob/blob_url_store.mojom.h"
#include "third_party/blink/public/mojom/browser_interface_broker.mojom.h"
#include "third_party/blink/public/mojom/loader/fetch_client_settings_object.mojom.h"
#include "third_party/blink/public/mojom/renderer_preference_watcher.mojom.h"
#include "third_party/blink/public/mojom/service_worker/controller_service_worker.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_provider.mojom.h"
#include "third_party/blink/public/mojom/tokens/tokens.mojom.h"
#include "third_party/blink/public/mojom/worker/subresource_loader_updater.mojom.h"
#include "third_party/blink/public/mojom/worker/worker_main_script_load_params.mojom.h"
#include "third_party/blink/public/platform/child_url_loader_factory_bundle.h"
#include "third_party/blink/public/platform/web_dedicated_or_shared_worker_fetch_context.h"
#include "third_party/blink/public/platform/web_dedicated_worker.h"
#include "third_party/blink/public/platform/web_url.h"
namespace content {
DedicatedWorkerHostFactoryClient::DedicatedWorkerHostFactoryClient(
blink::WebDedicatedWorker* worker,
const blink::BrowserInterfaceBrokerProxy& interface_broker)
: … { … }
DedicatedWorkerHostFactoryClient::~DedicatedWorkerHostFactoryClient() = default;
void DedicatedWorkerHostFactoryClient::CreateWorkerHostDeprecated(
const blink::DedicatedWorkerToken& dedicated_worker_token,
const blink::WebURL& script_url,
const blink::WebSecurityOrigin& origin,
CreateWorkerHostCallback callback) { … }
void DedicatedWorkerHostFactoryClient::CreateWorkerHost(
const blink::DedicatedWorkerToken& dedicated_worker_token,
const blink::WebURL& script_url,
network::mojom::CredentialsMode credentials_mode,
const blink::WebFetchClientSettingsObject& fetch_client_settings_object,
blink::CrossVariantMojoRemote<blink::mojom::BlobURLTokenInterfaceBase>
blob_url_token,
net::StorageAccessApiStatus storage_access_api_status) { … }
scoped_refptr<blink::WebWorkerFetchContext>
DedicatedWorkerHostFactoryClient::CloneWorkerFetchContext(
blink::WebWorkerFetchContext* web_worker_fetch_context,
scoped_refptr<base::SingleThreadTaskRunner> task_runner) { … }
scoped_refptr<blink::WebDedicatedOrSharedWorkerFetchContext>
DedicatedWorkerHostFactoryClient::CreateWorkerFetchContext(
const blink::RendererPreferences& renderer_preference,
mojo::PendingReceiver<blink::mojom::RendererPreferenceWatcher>
watcher_receiver,
mojo::PendingRemote<blink::mojom::ResourceLoadInfoNotifier>
pending_resource_load_info_notifier) { … }
void DedicatedWorkerHostFactoryClient::OnWorkerHostCreated(
mojo::PendingRemote<blink::mojom::BrowserInterfaceBroker>
browser_interface_broker,
mojo::PendingRemote<blink::mojom::DedicatedWorkerHost>
dedicated_worker_host,
const url::Origin& origin) { … }
void DedicatedWorkerHostFactoryClient::OnScriptLoadStarted(
blink::mojom::ServiceWorkerContainerInfoForClientPtr
service_worker_container_info,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<blink::PendingURLLoaderFactoryBundle>
pending_subresource_loader_factory_bundle,
mojo::PendingReceiver<blink::mojom::SubresourceLoaderUpdater>
subresource_loader_updater,
blink::mojom::ControllerServiceWorkerInfoPtr controller_info,
mojo::PendingRemote<blink::mojom::BackForwardCacheControllerHost>
back_forward_cache_controller_host) { … }
void DedicatedWorkerHostFactoryClient::OnScriptLoadStartFailed() { … }
}