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
|
|
|
|
|
*/
|
|
|
|
|
|
2026-04-03 07:53:39 -03:00
|
|
|
#include <LibJS/Runtime/VM.h>
|
2023-08-23 13:26:47 -03:00
|
|
|
#include <LibWeb/Crypto/Crypto.h>
|
2023-04-14 16:27:52 -03:00
|
|
|
#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 {
|
|
|
|
|
|
2026-04-03 07:53:39 -03:00
|
|
|
NonnullRefPtr<SessionHistoryEntry> SessionHistoryEntry::create()
|
2022-12-12 06:58:30 -03:00
|
|
|
{
|
2026-04-03 07:53:39 -03:00
|
|
|
return adopt_ref(*new SessionHistoryEntry());
|
2022-12-12 06:58:30 -03:00
|
|
|
}
|
|
|
|
|
|
2026-04-03 07:53:39 -03:00
|
|
|
SessionHistoryEntry::~SessionHistoryEntry() = default;
|
|
|
|
|
|
|
|
|
|
RefPtr<DocumentState> SessionHistoryEntry::document_state() const { return m_document_state; }
|
|
|
|
|
void SessionHistoryEntry::set_document_state(RefPtr<DocumentState> document_state) { m_document_state = move(document_state); }
|
|
|
|
|
|
2023-08-23 13:26:47 -03:00
|
|
|
SessionHistoryEntry::SessionHistoryEntry()
|
2026-04-03 07:53:39 -03:00
|
|
|
: m_classic_history_api_state(MUST(structured_serialize_for_storage(JS::VM::the(), JS::js_null())))
|
|
|
|
|
, m_navigation_api_state(MUST(structured_serialize_for_storage(JS::VM::the(), 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
|
|
|
}
|