chromium/services/network/prefetch_url_loader_client.cc

// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "services/network/prefetch_url_loader_client.h"

#include <functional>
#include <optional>

#include "base/check.h"
#include "mojo/public/cpp/base/big_buffer.h"
#include "mojo/public/cpp/system/data_pipe.h"
#include "services/network/prefetch_cache.h"
#include "services/network/public/cpp/resource_request.h"
#include "services/network/public/mojom/early_hints.mojom.h"
#include "services/network/public/mojom/url_loader.mojom.h"
#include "services/network/public/mojom/url_response_head.mojom.h"

namespace network {

namespace {

// Returns true for a response code that we'd like to use.
bool IsNiceResponseCode(int response_code) {}

// Returns true if this prefetch has attributes that make it unattractive to
// use.
bool ShouldAbandonPrefetch(const mojom::URLResponseHead& head) {}

}  // namespace

PrefetchURLLoaderClient::PrefetchURLLoaderClient(
    base::PassKey<PrefetchCache>,
    const net::NetworkIsolationKey& nik,
    const ResourceRequest& request,
    base::TimeTicks expiry_time,
    PrefetchCache* prefetch_cache)
    :{}

PrefetchURLLoaderClient::~PrefetchURLLoaderClient() = default;

mojo::PendingReceiver<mojom::URLLoader>
PrefetchURLLoaderClient::GetURLLoaderPendingReceiver() {}

mojo::PendingRemote<mojom::URLLoaderClient>
PrefetchURLLoaderClient::BindNewPipeAndPassRemote() {}

void PrefetchURLLoaderClient::SetClient(
    mojo::PendingRemote<mojom::URLLoaderClient> client) {}

void PrefetchURLLoaderClient::OnReceiveEarlyHints(
    mojom::EarlyHintsPtr early_hints) {}

void PrefetchURLLoaderClient::OnReceiveResponse(
    mojom::URLResponseHeadPtr head,
    mojo::ScopedDataPipeConsumerHandle body,
    std::optional<mojo_base::BigBuffer> cached_metadata) {}

void PrefetchURLLoaderClient::OnReceiveRedirect(
    const net::RedirectInfo& redirect_info,
    mojom::URLResponseHeadPtr head) {}

void PrefetchURLLoaderClient::OnUploadProgress(
    int64_t current_position,
    int64_t total_size,
    OnUploadProgressCallback callback) {}

void PrefetchURLLoaderClient::OnTransferSizeUpdated(
    int32_t transfer_size_diff) {}

void PrefetchURLLoaderClient::OnComplete(
    const URLLoaderCompletionStatus& status) {}

void PrefetchURLLoaderClient::OnDisconnect() {}

template <typename Method, typename... Args>
void PrefetchURLLoaderClient::ForwardOrRecord(Method method, Args... args) {}

template <typename Method, typename... Args>
void PrefetchURLLoaderClient::ForwardToRealClient(Method method, Args... args) {}

}  // namespace network