#include "services/network/url_loader_factory.h"
#include <memory>
#include <optional>
#include <string>
#include <utility>
#include "base/check_op.h"
#include "base/functional/bind.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/notreached.h"
#include "components/content_settings/core/common/content_settings.h"
#include "mojo/public/cpp/bindings/message.h"
#include "net/base/isolation_info.h"
#include "net/cookies/cookie_constants.h"
#include "net/cookies/cookie_setting_override.h"
#include "net/url_request/url_request_context.h"
#include "services/network/attribution/attribution_request_helper.h"
#include "services/network/cookie_manager.h"
#include "services/network/cookie_settings.h"
#include "services/network/cors/cors_url_loader_factory.h"
#include "services/network/network_context.h"
#include "services/network/network_service.h"
#include "services/network/public/cpp/features.h"
#include "services/network/public/cpp/is_potentially_trustworthy.h"
#include "services/network/public/cpp/load_info_util.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/devtools_observer.mojom.h"
#include "services/network/public/mojom/network_context.mojom.h"
#include "services/network/resource_scheduler/resource_scheduler_client.h"
#include "services/network/shared_dictionary/shared_dictionary_access_checker.h"
#include "services/network/trust_tokens/trust_token_request_helper_factory.h"
#include "services/network/url_loader.h"
#include "services/network/web_bundle/web_bundle_url_loader_factory.h"
#include "url/gurl.h"
#include "url/origin.h"
namespace network {
namespace {
constexpr auto kUpdateLoadStatesInterval = …;
bool LoadInfoIsMoreInteresting(const URLLoader::PartialLoadInfo& a,
const URLLoader::PartialLoadInfo& b) { … }
}
constexpr int URLLoaderFactory::kMaxKeepaliveConnections;
constexpr int URLLoaderFactory::kMaxKeepaliveConnectionsPerTopLevelFrame;
constexpr int URLLoaderFactory::kMaxTotalKeepaliveRequestSize;
URLLoaderFactory::URLLoaderFactory(
NetworkContext* context,
mojom::URLLoaderFactoryParamsPtr params,
scoped_refptr<ResourceSchedulerClient> resource_scheduler_client,
cors::CorsURLLoaderFactory* cors_url_loader_factory)
: … { … }
URLLoaderFactory::~URLLoaderFactory() { … }
void URLLoaderFactory::CreateLoaderAndStart(
mojo::PendingReceiver<mojom::URLLoader> receiver,
int32_t request_id,
uint32_t options,
const ResourceRequest& resource_request,
mojo::PendingRemote<mojom::URLLoaderClient> client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) { … }
void URLLoaderFactory::Clone(
mojo::PendingReceiver<mojom::URLLoaderFactory> receiver) { … }
net::URLRequestContext* URLLoaderFactory::GetUrlRequestContext() const { … }
mojom::NetworkContextClient* URLLoaderFactory::GetNetworkContextClient() const { … }
const mojom::URLLoaderFactoryParams& URLLoaderFactory::GetFactoryParams()
const { … }
mojom::CrossOriginEmbedderPolicyReporter* URLLoaderFactory::GetCoepReporter()
const { … }
bool URLLoaderFactory::ShouldRequireIsolationInfo() const { … }
scoped_refptr<ResourceSchedulerClient>
URLLoaderFactory::GetResourceSchedulerClient() const { … }
mojom::TrustedURLLoaderHeaderClient*
URLLoaderFactory::GetUrlLoaderHeaderClient() const { … }
const cors::OriginAccessList& URLLoaderFactory::GetOriginAccessList() const { … }
orb::PerFactoryState& URLLoaderFactory::GetMutableOrbState() { … }
bool URLLoaderFactory::DataUseUpdatesEnabled() { … }
void URLLoaderFactory::CreateLoaderAndStartWithSyncClient(
mojo::PendingReceiver<mojom::URLLoader> receiver,
int32_t request_id,
uint32_t options,
const ResourceRequest& resource_request,
mojo::PendingRemote<mojom::URLLoaderClient> client,
base::WeakPtr<mojom::URLLoaderClient> sync_client,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation) { … }
net::handles::NetworkHandle URLLoaderFactory::GetBoundNetworkForTesting()
const { … }
mojom::DevToolsObserver* URLLoaderFactory::GetDevToolsObserver() const { … }
mojom::CookieAccessObserver* URLLoaderFactory::GetCookieAccessObserver() const { … }
mojom::TrustTokenAccessObserver* URLLoaderFactory::GetTrustTokenAccessObserver()
const { … }
mojom::URLLoaderNetworkServiceObserver*
URLLoaderFactory::GetURLLoaderNetworkServiceObserver() const { … }
void URLLoaderFactory::AckUpdateLoadInfo() { … }
void URLLoaderFactory::MaybeStartUpdateLoadInfoTimer() { … }
void URLLoaderFactory::UpdateLoadInfo() { … }
}