SessionHistoryEntry.cpp 843 B

1234567891011121314151617181920212223242526272829
  1. /*
  2. * Copyright (c) 2022, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Crypto/Crypto.h>
  7. #include <LibWeb/HTML/BrowsingContext.h>
  8. #include <LibWeb/HTML/DocumentState.h>
  9. #include <LibWeb/HTML/SessionHistoryEntry.h>
  10. namespace Web::HTML {
  11. void SessionHistoryEntry::visit_edges(Cell::Visitor& visitor)
  12. {
  13. Base::visit_edges(visitor);
  14. visitor.visit(document_state);
  15. visitor.visit(original_source_browsing_context);
  16. }
  17. SessionHistoryEntry::SessionHistoryEntry()
  18. : classic_history_api_state(MUST(structured_serialize_for_storage(vm(), JS::js_null())))
  19. , navigation_api_state(MUST(structured_serialize_for_storage(vm(), JS::js_undefined())))
  20. , navigation_api_key(MUST(Crypto::generate_random_uuid()))
  21. , navigation_api_id(MUST(Crypto::generate_random_uuid()))
  22. {
  23. }
  24. }