1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:17:35 +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

@ -92,7 +92,6 @@ JS::NonnullGCPtr<Window> Window::create_with_document(DOM::Document& document)
Window::Window(JS::Realm& realm)
: DOM::EventTarget(realm)
, m_crypto(Crypto::Crypto::create())
{
// FIXME: Should this be WindowPrototype?
}
@ -100,7 +99,6 @@ Window::Window(JS::Realm& realm)
Window::Window(DOM::Document& document)
: DOM::EventTarget(document.shape().realm())
, m_associated_document(document)
, m_crypto(Crypto::Crypto::create())
{
}
@ -766,6 +764,8 @@ void Window::initialize(JS::Realm& realm)
Object::set_prototype(&ensure_web_prototype<Bindings::WindowPrototype>("Window"));
m_crypto = Crypto::Crypto::create(*this);
// FIXME: These should be native accessors, not properties
define_direct_property("window", this, JS::Attribute::Enumerable);
define_direct_property("frames", this, JS::Attribute::Enumerable);

View file

@ -147,7 +147,7 @@ private:
HashMap<int, JS::NonnullGCPtr<Timer>> m_timers;
JS::GCPtr<HighResolutionTime::Performance> m_performance;
NonnullRefPtr<Crypto::Crypto> m_crypto;
RefPtr<Crypto::Crypto> m_crypto;
JS::GCPtr<CSS::Screen> m_screen;
AnimationFrameCallbackDriver m_animation_frame_callback_driver;