mirror of
https://github.com/RGBCube/serenity
synced 2025-07-28 14:07:45 +00:00
LibWeb: Remove now-unused Bindings::Wrappable class
This commit is contained in:
parent
b1b5d75ce6
commit
3768743a0a
16 changed files with 0 additions and 77 deletions
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
#include <LibWeb/Bindings/Wrapper.h>
|
||||
|
||||
namespace Web {
|
||||
namespace Bindings {
|
||||
|
||||
void Wrappable::set_wrapper(Wrapper& wrapper)
|
||||
{
|
||||
VERIFY(!m_wrapper);
|
||||
m_wrapper = wrapper.make_weak_ptr<Wrapper>();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/WeakPtr.h>
|
||||
#include <LibJS/Heap/Heap.h>
|
||||
#include <LibJS/Runtime/GlobalObject.h>
|
||||
#include <LibWeb/Forward.h>
|
||||
|
||||
namespace Web::Bindings {
|
||||
|
||||
class Wrappable {
|
||||
public:
|
||||
virtual ~Wrappable() = default;
|
||||
|
||||
void set_wrapper(Wrapper&);
|
||||
Wrapper* wrapper() { return m_wrapper; }
|
||||
Wrapper const* wrapper() const { return m_wrapper; }
|
||||
|
||||
private:
|
||||
WeakPtr<Wrapper> m_wrapper;
|
||||
};
|
||||
|
||||
template<class NativeObject>
|
||||
inline Wrapper* wrap_impl(JS::Realm& realm, NativeObject& native_object)
|
||||
{
|
||||
if (!native_object.wrapper()) {
|
||||
native_object.set_wrapper(*realm.heap().allocate<typename NativeObject::WrapperType>(realm, realm, native_object));
|
||||
}
|
||||
return native_object.wrapper();
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue