mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-05 00:21:52 +00:00
Before this change, we were going through the chain of base classes for each IDL interface object and having them set the prototype to their prototype. Instead of doing that, reorder things so that we set the right prototype immediately in Foo::initialize(), and then don't bother in all the base class overrides. This knocks off a ~1% profile item on Speedometer 3.
39 lines
892 B
C++
39 lines
892 B
C++
/*
|
|
* Copyright (c) 2024, Colin Reeder <colin@vpzom.click>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Bindings/Intrinsics.h>
|
|
#include <LibWeb/Bindings/PerformanceNavigationPrototype.h>
|
|
#include <LibWeb/NavigationTiming/PerformanceNavigation.h>
|
|
|
|
namespace Web::NavigationTiming {
|
|
|
|
GC_DEFINE_ALLOCATOR(PerformanceNavigation);
|
|
|
|
PerformanceNavigation::PerformanceNavigation(JS::Realm& realm, u16 type, u16 redirect_count)
|
|
: PlatformObject(realm)
|
|
, m_type(type)
|
|
, m_redirect_count(redirect_count)
|
|
{
|
|
}
|
|
PerformanceNavigation::~PerformanceNavigation() = default;
|
|
|
|
void PerformanceNavigation::initialize(JS::Realm& realm)
|
|
{
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceNavigation);
|
|
Base::initialize(realm);
|
|
}
|
|
|
|
u16 PerformanceNavigation::type() const
|
|
{
|
|
return m_type;
|
|
}
|
|
|
|
u16 PerformanceNavigation::redirect_count() const
|
|
{
|
|
return m_redirect_count;
|
|
}
|
|
|
|
}
|