#include "content/renderer/worker/embedded_shared_worker_stub.h"
#include <stdint.h>
#include <utility>
#include "base/feature_list.h"
#include "base/functional/bind.h"
#include "base/ranges/algorithm.h"
#include "content/renderer/content_security_policy_util.h"
#include "content/renderer/policy_container_util.h"
#include "content/renderer/worker/fetch_client_settings_object_helpers.h"
#include "services/network/public/cpp/shared_url_loader_factory.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/messaging/message_port_channel.h"
#include "third_party/blink/public/common/messaging/message_port_descriptor.h"
#include "third_party/blink/public/mojom/browser_interface_broker.mojom.h"
#include "third_party/blink/public/mojom/devtools/devtools_agent.mojom.h"
#include "third_party/blink/public/mojom/renderer_preference_watcher.mojom.h"
#include "third_party/blink/public/mojom/service_worker/service_worker_object.mojom.h"
#include "third_party/blink/public/mojom/worker/worker_content_settings_proxy.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_fetch_client_settings_object.h"
#include "third_party/blink/public/platform/web_string.h"
#include "third_party/blink/public/web/web_shared_worker.h"
#include "url/origin.h"
namespace content {
EmbeddedSharedWorkerStub::EmbeddedSharedWorkerStub(
blink::mojom::SharedWorkerInfoPtr info,
const blink::SharedWorkerToken& token,
const blink::StorageKey& constructor_key,
const url::Origin& origin,
bool is_constructor_secure_context,
const std::string& user_agent,
const blink::UserAgentMetadata& ua_metadata,
bool pause_on_start,
const base::UnguessableToken& devtools_worker_token,
const blink::RendererPreferences& renderer_preferences,
mojo::PendingReceiver<blink::mojom::RendererPreferenceWatcher>
preference_watcher_receiver,
mojo::PendingRemote<blink::mojom::WorkerContentSettingsProxy>
content_settings,
blink::mojom::ServiceWorkerContainerInfoForClientPtr
service_worker_container_info,
blink::mojom::WorkerMainScriptLoadParamsPtr main_script_load_params,
std::unique_ptr<blink::PendingURLLoaderFactoryBundle>
pending_subresource_loader_factory_bundle,
blink::mojom::ControllerServiceWorkerInfoPtr controller_info,
blink::mojom::PolicyContainerPtr policy_container,
mojo::PendingRemote<blink::mojom::SharedWorkerHost> host,
mojo::PendingReceiver<blink::mojom::SharedWorker> receiver,
mojo::PendingRemote<blink::mojom::BrowserInterfaceBroker>
browser_interface_broker,
ukm::SourceId ukm_source_id,
bool require_cross_site_request_for_cookies,
const std::vector<std::string>& cors_exempt_header_list)
: … { … }
EmbeddedSharedWorkerStub::~EmbeddedSharedWorkerStub() { … }
void EmbeddedSharedWorkerStub::WorkerContextDestroyed() { … }
scoped_refptr<blink::WebWorkerFetchContext>
EmbeddedSharedWorkerStub::CreateWorkerFetchContext(
const blink::StorageKey& constructor_key,
const blink::RendererPreferences& renderer_preferences,
mojo::PendingReceiver<blink::mojom::RendererPreferenceWatcher>
preference_watcher_receiver,
const std::vector<std::string>& cors_exempt_header_list,
bool require_cross_site_request_for_cookies) { … }
void EmbeddedSharedWorkerStub::Connect(int connection_request_id,
blink::MessagePortDescriptor port) { … }
void EmbeddedSharedWorkerStub::Terminate() { … }
}