mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Make SubtleCrypto GC-allocated
This commit is contained in:
parent
2ac8e3db3a
commit
7a9b8ced38
Notes:
sideshowbarker
2024-07-17 07:25:45 +09:00
Author: https://github.com/awesomekling
Commit: 7a9b8ced38
Pull-request: https://github.com/SerenityOS/serenity/pull/14816
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/linusg ✅
8 changed files with 38 additions and 29 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue