#include "third_party/blink/renderer/core/loader/loader_factory_for_frame.h"
#include "base/functional/bind.h"
#include "base/memory/scoped_refptr.h"
#include "base/numerics/safe_conversions.h"
#include "base/task/single_thread_task_runner.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/remote.h"
#include "services/network/public/cpp/wrapper_shared_url_loader_factory.h"
#include "services/network/public/mojom/url_loader_factory.mojom-blink.h"
#include "third_party/blink/public/common/blob/blob_utils.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/mojom/fetch/fetch_api_request.mojom-blink.h"
#include "third_party/blink/public/platform/cross_variant_mojo_util.h"
#include "third_party/blink/public/platform/modules/service_worker/web_service_worker_network_provider.h"
#include "third_party/blink/public/platform/platform.h"
#include "third_party/blink/public/platform/web_background_resource_fetch_assets.h"
#include "third_party/blink/public/web/web_local_frame.h"
#include "third_party/blink/public/web/web_local_frame_client.h"
#include "third_party/blink/renderer/core/fileapi/public_url_manager.h"
#include "third_party/blink/renderer/core/frame/local_dom_window.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/frame/local_frame_client.h"
#include "third_party/blink/renderer/core/loader/document_loader.h"
#include "third_party/blink/renderer/core/loader/prefetched_signed_exchange_manager.h"
#include "third_party/blink/renderer/platform/exported/wrapped_resource_request.h"
#include "third_party/blink/renderer/platform/loader/fetch/background_code_cache_host.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/background_url_loader.h"
#include "third_party/blink/renderer/platform/loader/fetch/url_loader/url_loader_factory.h"
#include "third_party/blink/renderer/platform/weborigin/kurl.h"
#include "third_party/blink/renderer/platform/wtf/std_lib_extras.h"
namespace blink {
namespace {
class BackgroundResourceFetchAssetsWithCustomLoaderFactory
: public WebBackgroundResourceFetchAssets { … };
Vector<String>& CorsExemptHeaderList() { … }
Vector<std::unique_ptr<URLLoaderThrottle>> CreateThrottlesImpl(
URLLoaderThrottleProvider* throttle_provider,
const LocalFrameToken local_frame_token,
const network::ResourceRequest* network_request) { … }
}
void LoaderFactoryForFrame::SetCorsExemptHeaderList(
Vector<String> cors_exempt_header_list) { … }
Vector<String> LoaderFactoryForFrame::GetCorsExemptHeaderList() { … }
LoaderFactoryForFrame::LoaderFactoryForFrame(DocumentLoader& document_loader,
LocalDOMWindow& window)
: … { … }
void LoaderFactoryForFrame::Trace(Visitor* visitor) const { … }
std::unique_ptr<URLLoader> LoaderFactoryForFrame::CreateURLLoader(
const network::ResourceRequest& network_request,
const ResourceLoaderOptions& options,
scoped_refptr<base::SingleThreadTaskRunner> freezable_task_runner,
scoped_refptr<base::SingleThreadTaskRunner> unfreezable_task_runner,
BackForwardCacheLoaderHelper* back_forward_cache_loader_helper,
const std::optional<base::UnguessableToken>&
service_worker_race_network_request_token,
bool is_from_origin_dirty_style_sheet) { … }
CodeCacheHost* LoaderFactoryForFrame::GetCodeCacheHost() { … }
mojo::PendingRemote<mojom::blink::KeepAliveHandle>
LoaderFactoryForFrame::MaybeIssueKeepAliveHandle(
const network::ResourceRequest& network_request) { … }
scoped_refptr<BackgroundCodeCacheHost>
LoaderFactoryForFrame::GetBackgroundCodeCacheHost() { … }
URLLoaderThrottleProvider*
LoaderFactoryForFrame::GetURLLoaderThrottleProvider() { … }
Vector<std::unique_ptr<URLLoaderThrottle>>
LoaderFactoryForFrame::CreateThrottles(
const network::ResourceRequest& network_request) { … }
}