mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-18 09:50:27 +00:00
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.
29 lines
543 B
C++
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;
|
|
};
|
|
|
|
}
|