chromium/services/network/prefetch_matching_url_loader_factory.h

// 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.

#ifndef SERVICES_NETWORK_PREFETCH_MATCHING_URL_LOADER_FACTORY_H_
#define SERVICES_NETWORK_PREFETCH_MATCHING_URL_LOADER_FACTORY_H_

#include <stdint.h>

#include <memory>
#include <set>

#include "base/memory/raw_ptr.h"
#include "base/memory/scoped_refptr.h"
#include "base/unguessable_token.h"
#include "mojo/public/cpp/bindings/pending_receiver.h"
#include "mojo/public/cpp/bindings/pending_remote.h"
#include "mojo/public/cpp/bindings/receiver_set.h"
#include "net/base/network_handle.h"
#include "services/network/public/mojom/network_context.mojom-forward.h"
#include "services/network/public/mojom/url_loader.mojom-forward.h"
#include "services/network/public/mojom/url_loader_factory.mojom.h"
#include "url/gurl.h"

namespace base {
class UnguessableToken;
}

namespace net {
struct MutableNetworkTrafficAnnotationTag;
}

namespace network {

namespace cors {
class CorsURLLoaderFactory;
class OriginAccessList;
}  // namespace cors

class NetworkContext;
class PrefetchCache;
class ResourceSchedulerClient;
struct ResourceRequest;

// An implementation of URLLoaderFactory that attempts to match against a cache
// of available prefetches. It no matching prefetches are available, it falls
// back to the CORSUrlLoaderFactory.
class COMPONENT_EXPORT(NETWORK_SERVICE) PrefetchMatchingURLLoaderFactory final
    : public mojom::URLLoaderFactory {};

}  // namespace network

#endif  // SERVICES_NETWORK_PREFETCH_MATCHING_URL_LOADER_FACTORY_H_