#include "third_party/blink/renderer/modules/service_worker/navigation_preload_request.h"
#include <utility>
#include "net/http/http_response_headers.h"
#include "services/network/public/cpp/record_ontransfersizeupdate_utils.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/mojom/service_worker/service_worker_error_type.mojom-blink.h"
#include "third_party/blink/public/web/modules/service_worker/web_service_worker_context_client.h"
namespace blink {
std::unique_ptr<WebNavigationPreloadRequest>
WebNavigationPreloadRequest::Create(
WebServiceWorkerContextClient* owner,
int fetch_event_id,
const WebURL& url,
mojo::PendingReceiver<network::mojom::URLLoaderClient>
preload_url_loader_client_receiver) { … }
NavigationPreloadRequest::NavigationPreloadRequest(
WebServiceWorkerContextClient* owner,
int fetch_event_id,
const WebURL& url,
mojo::PendingReceiver<network::mojom::URLLoaderClient>
preload_url_loader_client_receiver)
: … { … }
NavigationPreloadRequest::~NavigationPreloadRequest() = default;
void NavigationPreloadRequest::OnReceiveEarlyHints(
network::mojom::EarlyHintsPtr early_hints) { … }
void NavigationPreloadRequest::OnReceiveResponse(
network::mojom::URLResponseHeadPtr response_head,
mojo::ScopedDataPipeConsumerHandle body,
std::optional<mojo_base::BigBuffer> cached_metadata) { … }
void NavigationPreloadRequest::OnReceiveRedirect(
const net::RedirectInfo& redirect_info,
network::mojom::URLResponseHeadPtr response_head) { … }
void NavigationPreloadRequest::OnUploadProgress(
int64_t current_position,
int64_t total_size,
OnUploadProgressCallback ack_callback) { … }
void NavigationPreloadRequest::OnTransferSizeUpdated(
int32_t transfer_size_diff) { … }
void NavigationPreloadRequest::OnComplete(
const network::URLLoaderCompletionStatus& status) { … }
void NavigationPreloadRequest::MaybeReportResponseToOwner() { … }
void NavigationPreloadRequest::ReportErrorToOwner(
const WebString& message,
WebServiceWorkerError::Mode error_mode) { … }
}