| 
									
										
										
										
											2024-03-05 09:42:10 -07:00
										 |  |  | /*
 | 
					
						
							|  |  |  |  * Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org> | 
					
						
							|  |  |  |  * | 
					
						
							|  |  |  |  * SPDX-License-Identifier: BSD-2-Clause | 
					
						
							|  |  |  |  */ | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #include <LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h>
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | namespace Web::HTML { | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-15 04:01:23 +13:00
										 |  |  | GC_DEFINE_ALLOCATOR(EnvironmentSettingsSnapshot); | 
					
						
							| 
									
										
										
										
											2024-03-05 09:42:10 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-25 14:30:12 +00:00
										 |  |  | EnvironmentSettingsSnapshot::EnvironmentSettingsSnapshot(JS::Realm& realm, NonnullOwnPtr<JS::ExecutionContext> execution_context, SerializedEnvironmentSettingsObject const& serialized_settings) | 
					
						
							| 
									
										
										
										
											2024-03-05 09:42:10 -07:00
										 |  |  |     : EnvironmentSettingsObject(move(execution_context)) | 
					
						
							|  |  |  |     , m_api_url_character_encoding(serialized_settings.api_url_character_encoding) | 
					
						
							|  |  |  |     , m_url(serialized_settings.api_base_url) | 
					
						
							|  |  |  |     , m_origin(serialized_settings.origin) | 
					
						
							| 
									
										
										
										
											2025-04-26 11:35:51 +12:00
										 |  |  |     , m_policy_container(create_a_policy_container_from_serialized_policy_container(realm.heap(), serialized_settings.policy_container)) | 
					
						
							| 
									
										
										
										
											2025-01-07 10:08:14 +00:00
										 |  |  |     , m_time_origin(serialized_settings.time_origin) | 
					
						
							| 
									
										
										
										
											2024-03-05 09:42:10 -07:00
										 |  |  | { | 
					
						
							|  |  |  |     // Why can't we put these in the init list? grandparent class members are strange it seems
 | 
					
						
							|  |  |  |     this->id = serialized_settings.id; | 
					
						
							|  |  |  |     this->creation_url = serialized_settings.creation_url; | 
					
						
							|  |  |  |     this->top_level_creation_url = serialized_settings.top_level_creation_url; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | // Out of line to ensure this class has a key function
 | 
					
						
							|  |  |  | EnvironmentSettingsSnapshot::~EnvironmentSettingsSnapshot() = default; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-11-25 14:30:12 +00:00
										 |  |  | void EnvironmentSettingsSnapshot::visit_edges(Cell::Visitor& visitor) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     Base::visit_edges(visitor); | 
					
						
							|  |  |  |     visitor.visit(m_policy_container); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-05 09:42:10 -07:00
										 |  |  | } |