dymokomi/luce-browser-engine
Source of release 0.6.0
0.6.0 / src / web / html / source_snapshot_params.lucb
#==============================================================================================
#
# source_snapshot_params - HTML::SourceSnapshotParams: what a navigation snapshots of its
# source document
#
# DESCRIPTION:
# Port of Libraries/LibWeb/HTML/SourceSnapshotParams.cpp (lines 1-20) and the constructor
# of SourceSnapshotParams.h, taken by region r28: Document::snapshot_source_snapshot_params
# makes one and navigation reads it.
#
# Copyright (c) 2023, Andreas Kling <andreas@ladybird.org>
# SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================
## Ported from SourceSnapshotParams.h:21 Web::HTML::SourceSnapshotParams::SourceSnapshotParams
## (heap.allocate<HTML::SourceSnapshotParams>(...): a cell constructed under DeferGC).
pub func heap_allocate_html_source_snapshot_params(heap: gc.Heap*, has_transient_activation: bool, sandboxing_flags: HtmlSandboxingFlagSet, allows_downloading: bool, fetch_client: HtmlEnvironmentSettingsObject*, source_policy_container: HtmlPolicyContainer*) -> HtmlSourceSnapshotParams*:
let this = (HtmlSourceSnapshotParams*)web_heap_allocate_cell(heap, &html_source_snapshot_params_class)
this.has_transient_activation = has_transient_activation
this.sandboxing_flags = sandboxing_flags
this.allows_downloading = allows_downloading
this.fetch_client = fetch_client
this.source_policy_container = source_policy_container
return this
## Ported from SourceSnapshotParams.cpp:13 Web::HTML::SourceSnapshotParams::visit_edges (override).
pub func html_source_snapshot_params_visit_edges_impl(base: gc.Cell*, visitor: gc.CellVisitor*):
let this = (HtmlSourceSnapshotParams*)base
gc.cell_visit_edges_impl(base, visitor)
gc.cell_visitor_visit_t_2(visitor, this.fetch_client)
gc.cell_visitor_visit_t_2(visitor, this.source_policy_container)