#include "third_party/blink/renderer/core/loader/worker_fetch_context.h"
#include "base/task/single_thread_task_runner.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/public/platform/web_url_request.h"
#include "third_party/blink/public/platform/web_worker_fetch_context.h"
#include "third_party/blink/renderer/core/frame/deprecation/deprecation.h"
#include "third_party/blink/renderer/core/loader/mixed_content_checker.h"
#include "third_party/blink/renderer/core/loader/subresource_filter.h"
#include "third_party/blink/renderer/core/probe/core_probes.h"
#include "third_party/blink/renderer/core/timing/worker_global_scope_performance.h"
#include "third_party/blink/renderer/core/workers/worker_clients.h"
#include "third_party/blink/renderer/core/workers/worker_global_scope.h"
#include "third_party/blink/renderer/platform/exported/wrapped_resource_request.h"
#include "third_party/blink/renderer/platform/instrumentation/use_counter.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_client_settings_object.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher_properties.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_timing_utils.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader_factory.h"
#include "third_party/blink/renderer/platform/loader/fetch/worker_resource_timing_notifier.h"
#include "third_party/blink/renderer/platform/network/network_state_notifier.h"
#include "third_party/blink/renderer/platform/runtime_enabled_features.h"
#include "third_party/blink/renderer/platform/scheduler/public/virtual_time_controller.h"
#include "third_party/blink/renderer/platform/supplementable.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
namespace blink {
WorkerFetchContext::~WorkerFetchContext() = default;
WorkerFetchContext::WorkerFetchContext(
const DetachableResourceFetcherProperties& properties,
WorkerOrWorkletGlobalScope& global_scope,
scoped_refptr<WebWorkerFetchContext> web_context,
SubresourceFilter* subresource_filter,
ContentSecurityPolicy& content_security_policy,
WorkerResourceTimingNotifier& resource_timing_notifier)
: … { … }
net::SiteForCookies WorkerFetchContext::GetSiteForCookies() const { … }
scoped_refptr<const SecurityOrigin> WorkerFetchContext::GetTopFrameOrigin()
const { … }
SubresourceFilter* WorkerFetchContext::GetSubresourceFilter() const { … }
bool WorkerFetchContext::AllowScript() const { … }
bool WorkerFetchContext::ShouldBlockRequestByInspector(const KURL& url) const { … }
void WorkerFetchContext::DispatchDidBlockRequest(
const ResourceRequest& resource_request,
const ResourceLoaderOptions& options,
ResourceRequestBlockedReason blocked_reason,
ResourceType resource_type) const { … }
ContentSecurityPolicy* WorkerFetchContext::GetContentSecurityPolicyForWorld(
const DOMWrapperWorld* world) const { … }
bool WorkerFetchContext::IsIsolatedSVGChromeClient() const { … }
void WorkerFetchContext::CountUsage(WebFeature feature) const { … }
void WorkerFetchContext::CountDeprecation(WebFeature feature) const { … }
CoreProbeSink* WorkerFetchContext::Probe() const { … }
bool WorkerFetchContext::ShouldBlockWebSocketByMixedContentCheck(
const KURL& url) const { … }
std::unique_ptr<WebSocketHandshakeThrottle>
WorkerFetchContext::CreateWebSocketHandshakeThrottle() { … }
bool WorkerFetchContext::ShouldBlockFetchByMixedContentCheck(
mojom::blink::RequestContextType request_context,
network::mojom::blink::IPAddressSpace target_address_space,
base::optional_ref<const ResourceRequest::RedirectInfo> redirect_info,
const KURL& url,
ReportingDisposition reporting_disposition,
const String& devtools_id) const { … }
bool WorkerFetchContext::ShouldBlockFetchAsCredentialedSubresource(
const ResourceRequest& resource_request,
const KURL& url) const { … }
const KURL& WorkerFetchContext::Url() const { … }
ContentSecurityPolicy* WorkerFetchContext::GetContentSecurityPolicy() const { … }
void WorkerFetchContext::PrepareRequest(
ResourceRequest& request,
ResourceLoaderOptions& options,
WebScopedVirtualTimePauser& virtual_time_pauser,
ResourceType resource_type) { … }
void WorkerFetchContext::AddAdditionalRequestHeaders(ResourceRequest& request) { … }
void WorkerFetchContext::AddResourceTiming(
mojom::blink::ResourceTimingInfoPtr info,
const AtomicString& initiator_type) { … }
void WorkerFetchContext::PopulateResourceRequestBeforeCacheAccess(
const ResourceLoaderOptions& options,
ResourceRequest& request) { … }
void WorkerFetchContext::WillSendRequest(ResourceRequest& request) { … }
void WorkerFetchContext::UpgradeResourceRequestForLoader(
ResourceType type,
const std::optional<float> resource_width,
ResourceRequest& out_request,
const ResourceLoaderOptions& options) { … }
std::unique_ptr<ResourceLoadInfoNotifierWrapper>
WorkerFetchContext::CreateResourceLoadInfoNotifierWrapper() { … }
void WorkerFetchContext::SetFirstPartyCookie(ResourceRequest& out_request) { … }
WorkerSettings* WorkerFetchContext::GetWorkerSettings() const { … }
bool WorkerFetchContext::AllowRunningInsecureContent(
bool enabled_per_settings,
const KURL& url) const { … }
mojom::blink::ContentSecurityNotifier&
WorkerFetchContext::GetContentSecurityNotifier() { … }
ExecutionContext* WorkerFetchContext::GetExecutionContext() const { … }
void WorkerFetchContext::Trace(Visitor* visitor) const { … }
}