mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 08:33:19 +00:00
AK+LibURL: Move AK::URL into a new URL library
This URL library ends up being a relatively fundamental base library of the system, as LibCore depends on LibURL. This change has two main benefits: * Moving AK back more towards being an agnostic library that can be used between the kernel and userspace. URL has never really fit that description - and is not used in the kernel. * URL _should_ depend on LibUnicode, as it needs punnycode support. However, it's not really possible to do this inside of AK as it can't depend on any external library. This change brings us a little closer to being able to do that, but unfortunately we aren't there quite yet, as the code generators depend on LibCore.
This commit is contained in:
parent
21bfa001b1
commit
e800605ad3
Notes:
sideshowbarker
2024-07-17 04:41:05 +09:00
Author: https://github.com/shannonbooth
Commit: e800605ad3
Pull-request: https://github.com/SerenityOS/serenity/pull/23443
Issue: https://github.com/SerenityOS/serenity/issues/22884
Reviewed-by: https://github.com/trflynn89
403 changed files with 1336 additions and 1305 deletions
|
@ -21,17 +21,17 @@ void ModuleMap::visit_edges(Visitor& visitor)
|
|||
visitor.visit(callback);
|
||||
}
|
||||
|
||||
bool ModuleMap::is_fetching(URL const& url, ByteString const& type) const
|
||||
bool ModuleMap::is_fetching(URL::URL const& url, ByteString const& type) const
|
||||
{
|
||||
return is(url, type, EntryType::Fetching);
|
||||
}
|
||||
|
||||
bool ModuleMap::is_failed(URL const& url, ByteString const& type) const
|
||||
bool ModuleMap::is_failed(URL::URL const& url, ByteString const& type) const
|
||||
{
|
||||
return is(url, type, EntryType::Failed);
|
||||
}
|
||||
|
||||
bool ModuleMap::is(URL const& url, ByteString const& type, EntryType entry_type) const
|
||||
bool ModuleMap::is(URL::URL const& url, ByteString const& type, EntryType entry_type) const
|
||||
{
|
||||
auto value = m_values.get({ url, type });
|
||||
if (!value.has_value())
|
||||
|
@ -40,12 +40,12 @@ bool ModuleMap::is(URL const& url, ByteString const& type, EntryType entry_type)
|
|||
return value->type == entry_type;
|
||||
}
|
||||
|
||||
Optional<ModuleMap::Entry> ModuleMap::get(URL const& url, ByteString const& type) const
|
||||
Optional<ModuleMap::Entry> ModuleMap::get(URL::URL const& url, ByteString const& type) const
|
||||
{
|
||||
return m_values.get({ url, type });
|
||||
}
|
||||
|
||||
AK::HashSetResult ModuleMap::set(URL const& url, ByteString const& type, Entry entry)
|
||||
AK::HashSetResult ModuleMap::set(URL::URL const& url, ByteString const& type, Entry entry)
|
||||
{
|
||||
// NOTE: Re-entering this function while firing wait_for_change callbacks is not allowed.
|
||||
VERIFY(!m_firing_callbacks);
|
||||
|
@ -63,7 +63,7 @@ AK::HashSetResult ModuleMap::set(URL const& url, ByteString const& type, Entry e
|
|||
return value;
|
||||
}
|
||||
|
||||
void ModuleMap::wait_for_change(JS::Heap& heap, URL const& url, ByteString const& type, Function<void(Entry)> callback)
|
||||
void ModuleMap::wait_for_change(JS::Heap& heap, URL::URL const& url, ByteString const& type, Function<void(Entry)> callback)
|
||||
{
|
||||
m_callbacks.ensure({ url, type }).append(JS::create_heap_function(heap, move(callback)));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue