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:
parent
2ac8e3db3a
commit
7a9b8ced38
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