mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 08:08:12 +00:00
LibWeb: Add HTML::Window::cached_web_prototype()
This is a simpler version of ensure_web_prototype<T>(). This new version assumes that we already have a cached instance of the prototype.
This commit is contained in:
parent
6f433c8656
commit
8341f142ea
2 changed files with 12 additions and 0 deletions
|
@ -123,6 +123,16 @@ void Window::visit_edges(JS::Cell::Visitor& visitor)
|
|||
|
||||
Window::~Window() = default;
|
||||
|
||||
JS::Object& Window::cached_web_prototype(String const& class_name)
|
||||
{
|
||||
auto it = m_prototypes.find(class_name);
|
||||
if (it == m_prototypes.end()) {
|
||||
dbgln("Missing prototype: {}", class_name);
|
||||
}
|
||||
VERIFY(it != m_prototypes.end());
|
||||
return *it->value;
|
||||
}
|
||||
|
||||
HighResolutionTime::Performance& Window::performance()
|
||||
{
|
||||
if (!m_performance)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue