2021-01-18 15:06:13 +01:00
|
|
|
/*
|
2024-10-04 13:19:50 +02:00
|
|
|
* Copyright (c) 2021, Andreas Kling <andreas@ladybird.org>
|
2021-01-18 15:06:13 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2021-01-18 15:06:13 +01:00
|
|
|
*/
|
|
|
|
|
2024-04-27 12:09:58 +12:00
|
|
|
#include <LibWeb/Bindings/PerformanceTimingPrototype.h>
|
2021-01-18 15:06:13 +01:00
|
|
|
#include <LibWeb/NavigationTiming/PerformanceTiming.h>
|
|
|
|
|
|
|
|
namespace Web::NavigationTiming {
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DEFINE_ALLOCATOR(PerformanceTiming);
|
2023-11-19 19:47:52 +01:00
|
|
|
|
2024-04-05 18:04:01 -07:00
|
|
|
PerformanceTiming::PerformanceTiming(JS::Realm& realm)
|
|
|
|
: PlatformObject(realm)
|
2021-01-18 15:06:13 +01:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2022-03-14 13:21:51 -06:00
|
|
|
PerformanceTiming::~PerformanceTiming() = default;
|
2021-01-18 15:06:13 +01:00
|
|
|
|
2023-08-07 08:41:28 +02:00
|
|
|
void PerformanceTiming::initialize(JS::Realm& realm)
|
2023-01-10 06:28:20 -05:00
|
|
|
{
|
2023-08-07 08:41:28 +02:00
|
|
|
Base::initialize(realm);
|
2024-03-16 13:13:08 +01:00
|
|
|
WEB_SET_PROTOTYPE_FOR_INTERFACE(PerformanceTiming);
|
2023-01-10 06:28:20 -05:00
|
|
|
}
|
|
|
|
|
2025-01-06 10:26:55 +00:00
|
|
|
DOM::DocumentLoadTimingInfo const& PerformanceTiming::document_load_timing_info() const
|
|
|
|
{
|
|
|
|
auto& global_object = HTML::relevant_global_object(*this);
|
|
|
|
VERIFY(is<HTML::Window>(global_object));
|
|
|
|
auto& window = static_cast<HTML::Window&>(global_object);
|
|
|
|
auto document = window.document();
|
|
|
|
return document->load_timing_info();
|
|
|
|
}
|
|
|
|
|
2021-01-18 15:06:13 +01:00
|
|
|
}
|