#include "third_party/blink/public/common/service_worker/service_worker_loader_helpers.h"
#include <limits>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "base/feature_list.h"
#include "base/strings/stringprintf.h"
#include "mojo/public/cpp/bindings/self_owned_receiver.h"
#include "net/http/http_util.h"
#include "net/url_request/redirect_info.h"
#include "net/url_request/redirect_util.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/cpp/resource_request_body.h"
#include "services/network/public/mojom/fetch_api.mojom-shared.h"
#include "services/network/public/mojom/url_response_head.mojom.h"
#include "third_party/blink/public/common/blob/blob_utils.h"
#include "third_party/blink/public/common/features.h"
#include "third_party/blink/public/common/loader/resource_type_util.h"
#include "ui/base/page_transition_types.h"
namespace blink {
namespace {
class BlobCompleteCaller : public mojom::BlobReaderClient { … };
void SaveResponseHeaders(const mojom::FetchAPIResponse& response,
network::mojom::URLResponseHead* out_head) { … }
}
void ServiceWorkerLoaderHelpers::SaveResponseInfo(
const mojom::FetchAPIResponse& response,
network::mojom::URLResponseHead* out_head) { … }
std::optional<net::RedirectInfo>
ServiceWorkerLoaderHelpers::ComputeRedirectInfo(
const network::ResourceRequest& original_request,
const network::mojom::URLResponseHead& response_head) { … }
int ServiceWorkerLoaderHelpers::ReadBlobResponseBody(
mojo::Remote<mojom::Blob>* blob,
uint64_t blob_size,
base::OnceCallback<void(int)> on_blob_read_complete,
mojo::ScopedDataPipeConsumerHandle* handle_out) { … }
bool ServiceWorkerLoaderHelpers::IsMainRequestDestination(
network::mojom::RequestDestination destination) { … }
const char* ServiceWorkerLoaderHelpers::FetchResponseSourceToSuffix(
network::mojom::FetchResponseSource source) { … }
}