/* * Copyright (c) 2022, Linus Groh * * SPDX-License-Identifier: BSD-2-Clause */ #pragma once #include #include #include #include #include #include namespace Web::HTML { struct CrossOriginProperty { String property; Optional needs_get {}; Optional needs_set {}; }; struct CrossOriginKey { FlatPtr current_principal_settings_object; FlatPtr relevant_settings_object; JS::PropertyKey property_key; }; using CrossOriginPropertyDescriptorMap = HashMap; } namespace AK { template<> struct Traits : public DefaultTraits { static unsigned hash(Web::HTML::CrossOriginKey const& key) { return pair_int_hash( Traits::hash(key.property_key), pair_int_hash(ptr_hash(key.current_principal_settings_object), ptr_hash(key.relevant_settings_object))); } static bool equals(Web::HTML::CrossOriginKey const& a, Web::HTML::CrossOriginKey const& b) { return a.current_principal_settings_object == b.current_principal_settings_object && a.relevant_settings_object == b.relevant_settings_object && Traits::equals(a.property_key, b.property_key); } }; }