1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57: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

@ -10,12 +10,24 @@
#include <LibWeb/Bindings/DOMExceptionWrapper.h>
#include <LibWeb/Bindings/IDLAbstractOperations.h>
#include <LibWeb/Bindings/MainThreadVM.h>
#include <LibWeb/Bindings/Wrapper.h>
#include <LibWeb/Crypto/SubtleCrypto.h>
#include <LibWeb/DOM/DOMException.h>
namespace Web::Crypto {
JS::NonnullGCPtr<SubtleCrypto> SubtleCrypto::create(HTML::Window& window)
{
return *window.heap().allocate<SubtleCrypto>(window.realm(), window);
}
SubtleCrypto::SubtleCrypto(HTML::Window& window)
: PlatformObject(window.realm())
{
set_prototype(&window.cached_web_prototype("SubtleCrypto"));
}
SubtleCrypto::~SubtleCrypto() = default;
JS::Promise* SubtleCrypto::digest(String const& algorithm, JS::Handle<JS::Object> const& data)
{
auto& vm = Bindings::main_thread_vm();