EnvironmentSettingsSnapshot.cpp 1.2 KB

123456789101112131415161718192021222324252627282930
  1. /*
  2. * Copyright (c) 2024, Andrew Kaster <akaster@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/HTML/Scripting/EnvironmentSettingsSnapshot.h>
  7. namespace Web::HTML {
  8. JS_DEFINE_ALLOCATOR(EnvironmentSettingsSnapshot);
  9. EnvironmentSettingsSnapshot::EnvironmentSettingsSnapshot(NonnullOwnPtr<JS::ExecutionContext> execution_context, SerializedEnvironmentSettingsObject const& serialized_settings)
  10. : EnvironmentSettingsObject(move(execution_context))
  11. , m_api_url_character_encoding(serialized_settings.api_url_character_encoding)
  12. , m_url(serialized_settings.api_base_url)
  13. , m_origin(serialized_settings.origin)
  14. , m_policy_container(serialized_settings.policy_container)
  15. {
  16. // Why can't we put these in the init list? grandparent class members are strange it seems
  17. this->id = serialized_settings.id;
  18. this->creation_url = serialized_settings.creation_url;
  19. this->top_level_creation_url = serialized_settings.top_level_creation_url;
  20. this->top_level_creation_url = serialized_settings.top_level_creation_url;
  21. }
  22. // Out of line to ensure this class has a key function
  23. EnvironmentSettingsSnapshot::~EnvironmentSettingsSnapshot() = default;
  24. }