mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:37:36 +00:00
LibWeb: Add the SubtleCrypto interface
Just some boilerplate code to get started :^) This adds both the SubtleCrypto constructor to the window object, as well as the crypto.subtle instance attribute.
This commit is contained in:
parent
ce6c515873
commit
615be9eb7c
8 changed files with 57 additions and 2 deletions
34
Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h
Normal file
34
Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h
Normal file
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Linus Groh <linusg@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibWeb/Bindings/Wrappable.h>
|
||||
|
||||
namespace Web::Crypto {
|
||||
|
||||
class SubtleCrypto
|
||||
: public Bindings::Wrappable
|
||||
, public RefCounted<SubtleCrypto> {
|
||||
public:
|
||||
using WrapperType = Bindings::SubtleCryptoWrapper;
|
||||
|
||||
static NonnullRefPtr<SubtleCrypto> create()
|
||||
{
|
||||
return adopt_ref(*new SubtleCrypto());
|
||||
}
|
||||
|
||||
private:
|
||||
SubtleCrypto() = default;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
namespace Web::Bindings {
|
||||
|
||||
SubtleCryptoWrapper* wrap(JS::GlobalObject&, Crypto::SubtleCrypto&);
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue