1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-17 19:55:07 +00:00
serenity/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp
Timothy Flynn 834202aeb9 LibWeb: Move setting of Web object prototypes to initialize()
This needs to happen before prototype/constructor intitialization can be
made lazy. Otherwise, GC could run during the C++ constructor and try to
collect the object currently being created.
2023-01-10 16:08:14 +01:00

31 lines
718 B
C++

/*
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/NavigationTiming/PerformanceTiming.h>
namespace Web::NavigationTiming {
PerformanceTiming::PerformanceTiming(HTML::Window& window)
: PlatformObject(window.realm())
, m_window(window)
{
}
PerformanceTiming::~PerformanceTiming() = default;
void PerformanceTiming::initialize(JS::Realm& realm)
{
Base::initialize(realm);
set_prototype(&Bindings::ensure_web_prototype<Bindings::PerformanceTimingPrototype>(realm, "PerformanceTiming"));
}
void PerformanceTiming::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_window.ptr());
}
}