mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:57:34 +00:00
LibWeb: Use RefCountForwarder for NavigationTiming::PerformanceTiming
This object already forwarded its ref count to DOM::Window. This patch simply adopts the new RefCountForwarder base to achieve the same thing.
This commit is contained in:
parent
c9a35e104b
commit
e1287a9a45
2 changed files with 6 additions and 19 deletions
|
@ -4,13 +4,12 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/DOM/Window.h>
|
||||
#include <LibWeb/NavigationTiming/PerformanceTiming.h>
|
||||
|
||||
namespace Web::NavigationTiming {
|
||||
|
||||
PerformanceTiming::PerformanceTiming(DOM::Window& window)
|
||||
: m_window(window)
|
||||
: RefCountForwarder(window)
|
||||
{
|
||||
}
|
||||
|
||||
|
@ -18,14 +17,4 @@ PerformanceTiming::~PerformanceTiming()
|
|||
{
|
||||
}
|
||||
|
||||
void PerformanceTiming::ref()
|
||||
{
|
||||
m_window.ref();
|
||||
}
|
||||
|
||||
void PerformanceTiming::unref()
|
||||
{
|
||||
m_window.unref();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -6,12 +6,16 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <AK/RefCountForwarder.h>
|
||||
#include <AK/StdLibExtras.h>
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/DOM/Window.h>
|
||||
|
||||
namespace Web::NavigationTiming {
|
||||
|
||||
class PerformanceTiming final : public Bindings::Wrappable {
|
||||
class PerformanceTiming final
|
||||
: public RefCountForwarder<DOM::Window>
|
||||
, public Bindings::Wrappable {
|
||||
public:
|
||||
using WrapperType = Bindings::PerformanceTimingWrapper;
|
||||
using AllowOwnPtr = TrueType;
|
||||
|
@ -19,9 +23,6 @@ public:
|
|||
explicit PerformanceTiming(DOM::Window&);
|
||||
~PerformanceTiming();
|
||||
|
||||
void ref();
|
||||
void unref();
|
||||
|
||||
u32 navigation_start() { return 0; }
|
||||
u32 unload_event_start() { return 0; }
|
||||
u32 unload_event_end() { return 0; }
|
||||
|
@ -43,9 +44,6 @@ public:
|
|||
u32 dom_complete() { return 0; }
|
||||
u32 load_event_start() { return 0; }
|
||||
u32 load_event_end() { return 0; }
|
||||
|
||||
private:
|
||||
DOM::Window& m_window;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue