mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-05 06:32:30 +02:00
LibWeb: Make SubtleCrypto GC-allocated
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 07:25:45 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/7a9b8ced38 Pull-request: https://github.com/SerenityOS/serenity/pull/14816 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/linusg ✅
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user