mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 11:39:44 +03:00
LibWeb: Remove unused ResourceLoader::load_sync()
There are no remaining users of this API, everyone has been migrated to asynchronous resource loading.
This commit is contained in:
parent
db2b67dc5e
commit
9ed5a14af2
Notes:
sideshowbarker
2024-07-17 14:12:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/9ed5a14af2
@ -42,25 +42,6 @@ ResourceLoader::ResourceLoader(NonnullRefPtr<Protocol::RequestClient> protocol_c
|
||||
{
|
||||
}
|
||||
|
||||
void ResourceLoader::load_sync(LoadRequest& request, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback)
|
||||
{
|
||||
Core::EventLoop loop;
|
||||
|
||||
load(
|
||||
request,
|
||||
[&](auto data, auto& response_headers, auto status_code) {
|
||||
success_callback(data, response_headers, status_code);
|
||||
loop.quit(0);
|
||||
},
|
||||
[&](auto& string, auto status_code) {
|
||||
if (error_callback)
|
||||
error_callback(string, status_code);
|
||||
loop.quit(0);
|
||||
});
|
||||
|
||||
loop.exec();
|
||||
}
|
||||
|
||||
void ResourceLoader::prefetch_dns(AK::URL const& url)
|
||||
{
|
||||
m_protocol_client->ensure_connection(url, RequestServer::CacheLevel::ResolveOnly);
|
||||
|
@ -35,7 +35,6 @@ public:
|
||||
|
||||
void load(LoadRequest&, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback = nullptr);
|
||||
void load(const AK::URL&, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback = nullptr);
|
||||
void load_sync(LoadRequest&, Function<void(ReadonlyBytes, HashMap<String, String, CaseInsensitiveStringTraits> const& response_headers, Optional<u32> status_code)> success_callback, Function<void(String const&, Optional<u32> status_code)> error_callback = nullptr);
|
||||
|
||||
void prefetch_dns(AK::URL const&);
|
||||
void preconnect(AK::URL const&);
|
||||
|
Loading…
Reference in New Issue
Block a user