#ifndef CONTENT_PUBLIC_BROWSER_PREFETCH_HANDLE_H_
#define CONTENT_PUBLIC_BROWSER_PREFETCH_HANDLE_H_
#include <optional>
#include "base/functional/callback_forward.h"
#include "services/network/public/mojom/url_response_head.mojom-forward.h"
namespace network {
struct URLLoaderCompletionStatus;
}
namespace content {
class PrefetchHandle {
public:
PrefetchHandle() = default;
virtual ~PrefetchHandle() = default;
PrefetchHandle(const PrefetchHandle& other) = delete;
PrefetchHandle& operator=(const PrefetchHandle& other) = delete;
PrefetchHandle(PrefetchHandle&& other) = default;
PrefetchHandle& operator=(PrefetchHandle&& other) = default;
virtual void SetOnPrefetchHeadReceivedCallback(
base::RepeatingCallback<void(const network::mojom::URLResponseHead&)>
on_prefetch_head_received) = 0;
virtual void SetOnPrefetchCompletedOrFailedCallback(
base::RepeatingCallback<
void(const network::URLLoaderCompletionStatus& completion_status,
const std::optional<int>& response_code)>
on_prefetch_completed_or_failed) = 0;
virtual bool IsAlive() const = 0;
};
}
#endif