dymokomi/luce-browser-engine
Source of release 0.6.0
0.6.0 / src / web / high_resolution_time / performance.lucb
#==============================================================================================
#
# performance - HighResolutionTime::Performance: the object a global's performance answers
#
# DESCRIPTION:
# Port of Libraries/LibWeb/HighResolutionTime/Performance.cpp lines 26-44 (the
# constructor, initialize, visit_edges). Its JS-facing members (now, timeOrigin, mark,
# measure, getEntries, timing, navigation, ...) are phase 3; the resource timing buffer
# dispatches its buffer full event at it.
#
# Copyright (c) 2022, Luke Wilde <lukew@serenityos.org>
# SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================
## Ported from Performance.cpp:26 Web::HighResolutionTime::Performance::Performance.
pub func high_resolution_time_performance_construct(this: HighResolutionTimePerformance*, realm: Realm*):
dom_event_target_construct(this.dom_event_target(), realm)
## Ported from Performance.cpp:33 Web::HighResolutionTime::Performance::initialize (override).
pub func high_resolution_time_performance_initialize_impl(base: JsCell*, realm: Realm*):
web_set_prototype_for_interface(base, realm, BindInterfaceName.performance)
dom_event_target_initialize_impl(base, realm)
## Ported from Performance.cpp:39 Web::HighResolutionTime::Performance::visit_edges (override).
pub func high_resolution_time_performance_visit_edges_impl(base: gc.Cell*, visitor: gc.CellVisitor*):
let this = (HighResolutionTimePerformance*)base
dom_event_target_visit_edges_impl(base, visitor)
gc.cell_visitor_visit_cell(visitor, this.m_navigation)
gc.cell_visitor_visit_cell(visitor, this.m_timing)