mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:22:44 +00:00 
			
		
		
		
	 6e19ab2bbc
			
		
	
	
		6e19ab2bbc
		
	
	
	
	
		
			
			We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
		
			
				
	
	
		
			50 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			50 lines
		
	
	
	
		
			1.3 KiB
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * Copyright (c) 2022, Linus Groh <linusg@serenityos.org>
 | |
|  *
 | |
|  * SPDX-License-Identifier: BSD-2-Clause
 | |
|  */
 | |
| 
 | |
| #pragma once
 | |
| 
 | |
| #include <AK/Forward.h>
 | |
| #include <AK/Traits.h>
 | |
| #include <LibJS/Forward.h>
 | |
| 
 | |
| namespace Web::HTML {
 | |
| 
 | |
| struct CrossOriginProperty {
 | |
|     DeprecatedString property;
 | |
|     Optional<bool> needs_get {};
 | |
|     Optional<bool> needs_set {};
 | |
| };
 | |
| 
 | |
| struct CrossOriginKey {
 | |
|     FlatPtr current_settings_object;
 | |
|     FlatPtr relevant_settings_object;
 | |
|     JS::PropertyKey property_key;
 | |
| };
 | |
| 
 | |
| using CrossOriginPropertyDescriptorMap = HashMap<CrossOriginKey, JS::PropertyDescriptor>;
 | |
| 
 | |
| }
 | |
| 
 | |
| namespace AK {
 | |
| 
 | |
| template<>
 | |
| struct Traits<Web::HTML::CrossOriginKey> : public GenericTraits<Web::HTML::CrossOriginKey> {
 | |
|     static unsigned hash(Web::HTML::CrossOriginKey const& key)
 | |
|     {
 | |
|         return pair_int_hash(
 | |
|             Traits<JS::PropertyKey>::hash(key.property_key),
 | |
|             pair_int_hash(ptr_hash(key.current_settings_object), ptr_hash(key.relevant_settings_object)));
 | |
|     }
 | |
| 
 | |
|     static bool equals(Web::HTML::CrossOriginKey const& a, Web::HTML::CrossOriginKey const& b)
 | |
|     {
 | |
|         return a.current_settings_object == b.current_settings_object
 | |
|             && a.relevant_settings_object == b.relevant_settings_object
 | |
|             && Traits<JS::PropertyKey>::equals(a.property_key, b.property_key);
 | |
|     }
 | |
| };
 | |
| 
 | |
| }
 |