#include "content/browser/service_worker/service_worker_new_script_fetcher.h"
#include "content/browser/devtools/devtools_instrumentation.h"
#include "content/browser/service_worker/service_worker_context_core.h"
#include "content/browser/service_worker/service_worker_loader_helpers.h"
#include "content/browser/service_worker/service_worker_new_script_loader.h"
#include "content/public/browser/global_request_id.h"
#include "mojo/public/cpp/system/data_pipe_utils.h"
#include "services/network/public/cpp/record_ontransfersizeupdate_utils.h"
#include "services/network/public/cpp/url_loader_completion_status.h"
#include "services/network/public/mojom/early_hints.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/blink/public/common/storage_key/storage_key.h"
namespace content {
namespace {
const net::NetworkTrafficAnnotationTag
kServiceWorkerScriptLoadTrafficAnnotation = …;
}
ServiceWorkerNewScriptFetcher::ServiceWorkerNewScriptFetcher(
ServiceWorkerContextCore& context,
scoped_refptr<ServiceWorkerVersion> version,
scoped_refptr<network::SharedURLLoaderFactory> loader_factory,
blink::mojom::FetchClientSettingsObjectPtr fetch_client_settings_object,
const GlobalRenderFrameHostId& requesting_frame_id)
: … { … }
ServiceWorkerNewScriptFetcher::~ServiceWorkerNewScriptFetcher() = default;
void ServiceWorkerNewScriptFetcher::Start(StartCallback callback) { … }
void ServiceWorkerNewScriptFetcher::StartScriptLoadingWithNewResourceID(
int64_t resource_id) { … }
void ServiceWorkerNewScriptFetcher::OnReceiveEarlyHints(
network::mojom::EarlyHintsPtr early_hints) { … }
void ServiceWorkerNewScriptFetcher::OnReceiveResponse(
network::mojom::URLResponseHeadPtr response_head,
mojo::ScopedDataPipeConsumerHandle response_body,
std::optional<mojo_base::BigBuffer> cached_metadata) { … }
void ServiceWorkerNewScriptFetcher::OnReceiveRedirect(
const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr response_head) { … }
void ServiceWorkerNewScriptFetcher::OnUploadProgress(int64_t,
int64_t,
OnUploadProgressCallback) { … }
void ServiceWorkerNewScriptFetcher::OnTransferSizeUpdated(int32_t) { … }
void ServiceWorkerNewScriptFetcher::OnComplete(
const network::URLLoaderCompletionStatus& status) { … }
}