#include "third_party/blink/renderer/core/loader/base_fetch_context.h"
#include "base/command_line.h"
#include "services/network/public/cpp/request_mode.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/switches.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/mojom/loader/request_context_frame_type.mojom-blink.h"
#include "third_party/blink/public/platform/web_content_settings_client.h"
#include "third_party/blink/renderer/core/execution_context/execution_context.h"
#include "third_party/blink/renderer/core/frame/settings.h"
#include "third_party/blink/renderer/core/frame/web_feature.h"
#include "third_party/blink/renderer/core/inspector/console_message.h"
#include "third_party/blink/renderer/core/inspector/identifiers_factory.h"
#include "third_party/blink/renderer/core/loader/frame_client_hints_preferences_context.h"
#include "third_party/blink/renderer/core/loader/idna_util.h"
#include "third_party/blink/renderer/core/loader/subresource_filter.h"
#include "third_party/blink/renderer/platform/exported/wrapped_resource_request.h"
#include "third_party/blink/renderer/platform/heap/garbage_collected.h"
#include "third_party/blink/renderer/platform/loader/cors/cors.h"
#include "third_party/blink/renderer/platform/loader/fetch/fetch_initiator_type_names.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_fetcher_properties.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_load_priority.h"
#include "third_party/blink/renderer/platform/loader/fetch/resource_loading_log.h"
#include "third_party/blink/renderer/platform/network/network_state_notifier.h"
#include "third_party/blink/renderer/platform/weborigin/scheme_registry.h"
#include "third_party/blink/renderer/platform/weborigin/security_policy.h"
namespace blink {
std::optional<ResourceRequestBlockedReason> BaseFetchContext::CanRequest(
ResourceType type,
const ResourceRequest& resource_request,
const KURL& url,
const ResourceLoaderOptions& options,
ReportingDisposition reporting_disposition,
base::optional_ref<const ResourceRequest::RedirectInfo> redirect_info)
const { … }
std::optional<ResourceRequestBlockedReason>
BaseFetchContext::CanRequestBasedOnSubresourceFilterOnly(
ResourceType type,
const ResourceRequest& resource_request,
const KURL& url,
const ResourceLoaderOptions& options,
ReportingDisposition reporting_disposition,
base::optional_ref<const ResourceRequest::RedirectInfo> redirect_info)
const { … }
bool BaseFetchContext::CalculateIfAdSubresource(
const ResourceRequestHead& request,
base::optional_ref<const KURL> alias_url,
ResourceType type,
const FetchInitiatorInfo& initiator_info) { … }
void BaseFetchContext::PrintAccessDeniedMessage(const KURL& url) const { … }
std::optional<ResourceRequestBlockedReason>
BaseFetchContext::CheckCSPForRequest(
mojom::blink::RequestContextType request_context,
network::mojom::RequestDestination request_destination,
const KURL& url,
const ResourceLoaderOptions& options,
ReportingDisposition reporting_disposition,
const KURL& url_before_redirects,
ResourceRequest::RedirectStatus redirect_status) const { … }
std::optional<ResourceRequestBlockedReason>
BaseFetchContext::CheckAndEnforceCSPForRequest(
mojom::blink::RequestContextType request_context,
network::mojom::RequestDestination request_destination,
const KURL& url,
const ResourceLoaderOptions& options,
ReportingDisposition reporting_disposition,
const KURL& url_before_redirects,
ResourceRequest::RedirectStatus redirect_status) const { … }
std::optional<ResourceRequestBlockedReason>
BaseFetchContext::CheckCSPForRequestInternal(
mojom::blink::RequestContextType request_context,
network::mojom::RequestDestination request_destination,
const KURL& url,
const ResourceLoaderOptions& options,
ReportingDisposition reporting_disposition,
const KURL& url_before_redirects,
ResourceRequest::RedirectStatus redirect_status,
ContentSecurityPolicy::CheckHeaderType check_header_type) const { … }
std::optional<ResourceRequestBlockedReason>
BaseFetchContext::CanRequestInternal(
ResourceType type,
const ResourceRequest& resource_request,
const KURL& url,
const ResourceLoaderOptions& options,
ReportingDisposition reporting_disposition,
base::optional_ref<const ResourceRequest::RedirectInfo> redirect_info)
const { … }
void BaseFetchContext::Trace(Visitor* visitor) const { … }
}