From 1bf73482f5b41e29472a12bab3b0282ddb34c80d Mon Sep 17 00:00:00 2001 From: stelar7 Date: Fri, 15 Dec 2023 21:07:27 +0100 Subject: [PATCH] LibWeb: Add `using` statement for simpler type names --- Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp | 4 ++-- Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp index 3f0c0404d8..01ceea5fa8 100644 --- a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp +++ b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.cpp @@ -37,7 +37,7 @@ void SubtleCrypto::initialize(JS::Realm& realm) } // https://w3c.github.io/webcrypto/#dfn-normalize-an-algorithm -JS::ThrowCompletionOr SubtleCrypto::normalize_an_algorithm(Variant, String> const& algorithm, String operation) +JS::ThrowCompletionOr SubtleCrypto::normalize_an_algorithm(AlgorithmIdentifier const& algorithm, String operation) { auto& realm = this->realm(); @@ -110,7 +110,7 @@ JS::ThrowCompletionOr SubtleCrypto::normalize_an_algorithm( } // https://w3c.github.io/webcrypto/#dfn-SubtleCrypto-method-digest -JS::NonnullGCPtr SubtleCrypto::digest(Variant, String> const& algorithm, JS::Handle const& data) +JS::NonnullGCPtr SubtleCrypto::digest(AlgorithmIdentifier const& algorithm, JS::Handle const& data) { auto& realm = this->realm(); diff --git a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h index 386e6d8741..95ef93397b 100644 --- a/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h +++ b/Userland/Libraries/LibWeb/Crypto/SubtleCrypto.h @@ -27,19 +27,20 @@ class SubtleCrypto final : public Bindings::PlatformObject { JS_DECLARE_ALLOCATOR(SubtleCrypto); using SupportedAlgorithmsMap = HashMap>; + using AlgorithmIdentifier = Variant, String>; public: [[nodiscard]] static JS::NonnullGCPtr create(JS::Realm&); virtual ~SubtleCrypto() override; - JS::NonnullGCPtr digest(Variant, String> const& algorithm, JS::Handle const& data); + JS::NonnullGCPtr digest(AlgorithmIdentifier const& algorithm, JS::Handle const& data); private: explicit SubtleCrypto(JS::Realm&); virtual void initialize(JS::Realm&) override; - JS::ThrowCompletionOr normalize_an_algorithm(Variant, String> const& algorithm, String operation); + JS::ThrowCompletionOr normalize_an_algorithm(AlgorithmIdentifier const& algorithm, String operation); static SubtleCrypto::SupportedAlgorithmsMap& supported_algorithms_internal(); static SubtleCrypto::SupportedAlgorithmsMap supported_algorithms();