ladybird/Libraries/LibWebView/FileDownloader.h
Timothy Flynn f322e8a29c LibWebView+UI: Add a context menu item to download images
This introduces a simple FileDownloader to download files in the UI
process from RequestServer. We use this to download the context menu
image - this download is likely to hit the disk cache.
2026-02-05 07:27:34 -05:00

29 lines
543 B
C++

/*
* Copyright (c) 2026, Tim Flynn <trflynn89@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <AK/HashMap.h>
#include <AK/LexicalPath.h>
#include <AK/NonnullRefPtr.h>
#include <LibRequests/Forward.h>
#include <LibURL/Forward.h>
#include <LibWebView/Forward.h>
namespace WebView {
class WEBVIEW_API FileDownloader {
public:
FileDownloader();
~FileDownloader();
void download_file(URL::URL const&, LexicalPath);
private:
HashMap<u64, NonnullRefPtr<Requests::Request>> m_requests;
};
}