ladybird/Userland/Libraries/LibWeb/Bindings/Wrapper.h

37 lines
607 B
C
Raw Normal View History

2020-03-14 20:31:40 +01:00
/*
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
2020-03-14 20:31:40 +01:00
*/
#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
};
}