mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
LibWeb: Teach AK how to hash StorageKeys
This commit is contained in:
parent
2156de7172
commit
f4f70068a8
Notes:
github-actions[bot]
2024-10-09 21:59:41 +00:00
Author: https://github.com/ADKaster Commit: https://github.com/LadybirdBrowser/ladybird/commit/f4f70068a80 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1674 Reviewed-by: https://github.com/shannonbooth
1 changed files with 11 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Optional.h>
|
||||
#include <AK/Traits.h>
|
||||
#include <LibURL/Origin.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
|
@ -32,3 +33,13 @@ Optional<StorageKey> obtain_a_storage_key(HTML::Environment const&);
|
|||
StorageKey obtain_a_storage_key_for_non_storage_purposes(HTML::Environment const&);
|
||||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
template<>
|
||||
struct Traits<Web::StorageAPI::StorageKey> : public DefaultTraits<Web::StorageAPI::StorageKey> {
|
||||
static unsigned hash(Web::StorageAPI::StorageKey const& key)
|
||||
{
|
||||
return Traits<URL::Origin>::hash(key.origin);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue