mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-05 02:33:03 +00:00
Since this is a debug-only feature, let's not have it impact GC marking performance when you don't need it.
36 lines
607 B
C++
36 lines
607 B
C++
/*
|
|
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/NonnullRefPtr.h>
|
|
#include <AK/Weakable.h>
|
|
#include <LibJS/Runtime/Object.h>
|
|
#include <LibWeb/Forward.h>
|
|
|
|
namespace Web::Bindings {
|
|
|
|
class Wrapper
|
|
: public JS::Object
|
|
, public Weakable<Wrapper> {
|
|
JS_OBJECT(Wrapper, JS::Object);
|
|
|
|
public:
|
|
protected:
|
|
explicit Wrapper(Object& prototype)
|
|
: Object(prototype)
|
|
{
|
|
}
|
|
|
|
#ifdef JS_TRACK_ZOMBIE_CELLS
|
|
virtual void did_become_zombie() override
|
|
{
|
|
revoke_weak_ptrs();
|
|
}
|
|
#endif
|
|
};
|
|
|
|
}
|