2022-12-12 06:58:30 -03:00
|
|
|
/*
|
2024-10-04 08:19:50 -03:00
|
|
|
* Copyright (c) 2022, Andreas Kling <andreas@ladybird.org>
|
2022-12-12 06:58:30 -03:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
2023-08-23 13:26:47 -03:00
|
|
|
#include <LibWeb/Crypto/Crypto.h>
|
2023-04-14 16:27:52 -03:00
|
|
|
#include <LibWeb/HTML/BrowsingContext.h>
|
|
|
|
|
#include <LibWeb/HTML/DocumentState.h>
|
2022-12-12 06:58:30 -03:00
|
|
|
#include <LibWeb/HTML/SessionHistoryEntry.h>
|
2025-07-17 14:40:50 -03:00
|
|
|
#include <LibWeb/HTML/StructuredSerialize.h>
|
2022-12-12 06:58:30 -03:00
|
|
|
|
|
|
|
|
namespace Web::HTML {
|
|
|
|
|
|
2024-11-14 12:01:23 -03:00
|
|
|
GC_DEFINE_ALLOCATOR(SessionHistoryEntry);
|
2023-11-19 15:47:52 -03:00
|
|
|
|
2022-12-12 06:58:30 -03:00
|
|
|
void SessionHistoryEntry::visit_edges(Cell::Visitor& visitor)
|
|
|
|
|
{
|
|
|
|
|
Base::visit_edges(visitor);
|
2024-03-27 11:59:12 -03:00
|
|
|
visitor.visit(m_document_state);
|
|
|
|
|
visitor.visit(m_original_source_browsing_context);
|
2024-11-25 11:30:12 -03:00
|
|
|
visitor.visit(m_policy_container);
|
2022-12-12 06:58:30 -03:00
|
|
|
}
|
|
|
|
|
|
2023-08-23 13:26:47 -03:00
|
|
|
SessionHistoryEntry::SessionHistoryEntry()
|
2024-03-27 11:59:12 -03:00
|
|
|
: m_classic_history_api_state(MUST(structured_serialize_for_storage(vm(), JS::js_null())))
|
|
|
|
|
, m_navigation_api_state(MUST(structured_serialize_for_storage(vm(), JS::js_undefined())))
|
2026-03-24 09:33:21 -03:00
|
|
|
, m_navigation_api_key(Crypto::generate_random_uuid())
|
|
|
|
|
, m_navigation_api_id(Crypto::generate_random_uuid())
|
2023-08-23 13:26:47 -03:00
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-12 06:58:30 -03:00
|
|
|
}
|