1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 01:07:36 +00:00

LibWeb: Make SubtleCrypto GC-allocated

This commit is contained in:
Andreas Kling 2022-09-03 19:59:53 +02:00
parent 2ac8e3db3a
commit 7a9b8ced38
8 changed files with 38 additions and 29 deletions

View file

@ -19,20 +19,20 @@ class Crypto : public Bindings::Wrappable
public:
using WrapperType = Bindings::CryptoWrapper;
static NonnullRefPtr<Crypto> create()
static NonnullRefPtr<Crypto> create(HTML::Window& window)
{
return adopt_ref(*new Crypto());
return adopt_ref(*new Crypto(window));
}
NonnullRefPtr<SubtleCrypto> subtle() const { return m_subtle; }
JS::NonnullGCPtr<SubtleCrypto> subtle() const;
DOM::ExceptionOr<JS::Value> get_random_values(JS::Value array) const;
String random_uuid() const;
private:
Crypto();
explicit Crypto(HTML::Window&);
NonnullRefPtr<SubtleCrypto> m_subtle;
JS::Handle<SubtleCrypto> m_subtle;
};
}