#include "content/browser/worker_host/worker_script_loader.h"
#include "base/functional/bind.h"
#include "content/browser/loader/navigation_loader_interceptor.h"
#include "content/browser/loader/response_head_update_params.h"
#include "content/browser/service_worker/service_worker_client.h"
#include "content/browser/service_worker/service_worker_main_resource_handle.h"
#include "content/browser/service_worker/service_worker_main_resource_loader_interceptor.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "net/base/load_timing_info.h"
#include "net/url_request/redirect_util.h"
#include "services/network/public/cpp/record_ontransfersizeupdate_utils.h"
#include "services/network/public/cpp/shared_url_loader_factory.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "services/network/public/mojom/early_hints.mojom.h"
namespace content {
WorkerScriptLoader::WorkerScriptLoader(
int process_id,
const DedicatedOrSharedWorkerToken& worker_token,
int32_t request_id,
uint32_t options,
const network::ResourceRequest& resource_request,
const net::IsolationInfo& isolation_info,
mojo::PendingRemote<network::mojom::URLLoaderClient> client,
base::WeakPtr<ServiceWorkerMainResourceHandle> service_worker_handle,
const BrowserContextGetter& browser_context_getter,
scoped_refptr<network::SharedURLLoaderFactory> default_loader_factory,
const net::MutableNetworkTrafficAnnotationTag& traffic_annotation)
: … { … }
WorkerScriptLoader::~WorkerScriptLoader() { … }
base::WeakPtr<WorkerScriptLoader> WorkerScriptLoader::GetWeakPtr() { … }
void WorkerScriptLoader::Abort() { … }
void WorkerScriptLoader::Start() { … }
void WorkerScriptLoader::MaybeStartLoader(
ServiceWorkerMainResourceLoaderInterceptor* interceptor,
std::optional<NavigationLoaderInterceptor::Result> interceptor_result) { … }
void WorkerScriptLoader::LoadFromNetwork() { … }
void WorkerScriptLoader::FollowRedirect(
const std::vector<std::string>& removed_headers,
const net::HttpRequestHeaders& modified_headers,
const net::HttpRequestHeaders& modified_cors_exempt_headers,
const std::optional<GURL>& new_url) { … }
void WorkerScriptLoader::SetPriority(net::RequestPriority priority,
int32_t intra_priority_value) { … }
void WorkerScriptLoader::PauseReadingBodyFromNet() { … }
void WorkerScriptLoader::ResumeReadingBodyFromNet() { … }
void WorkerScriptLoader::OnReceiveEarlyHints(
network::mojom::EarlyHintsPtr early_hints) { … }
void WorkerScriptLoader::OnReceiveResponse(
network::mojom::URLResponseHeadPtr response_head,
mojo::ScopedDataPipeConsumerHandle body,
std::optional<mojo_base::BigBuffer> cached_metadata) { … }
void WorkerScriptLoader::OnReceiveRedirect(
const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr response_head) { … }
void WorkerScriptLoader::OnUploadProgress(
int64_t current_position,
int64_t total_size,
OnUploadProgressCallback ack_callback) { … }
void WorkerScriptLoader::OnTransferSizeUpdated(int32_t transfer_size_diff) { … }
void WorkerScriptLoader::OnComplete(
const network::URLLoaderCompletionStatus& status) { … }
void WorkerScriptLoader::OnFetcherCallbackCalled() { … }
void WorkerScriptLoader::CommitCompleted() { … }
}