Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
[WebCrypto] Remove the KeyAlgorithm type hierarchy
https://bugs.webkit.org/show_bug.cgi?id=175750 Patch by Sam Weinig <sam@webkit.org> on 2017-08-19 Reviewed by Chris Dumez. Removes the unnecessary indirection that existed to generate a KeyAlgorithm dictionary (or rather, one of its derived dictionaries) for a CryptoKey. We were calling the virtual buildAlgorithm(), which return a std::unique_ptr<KeyAlgorithm>, which we then casted to the correct derived class and called dictionary() on. This can now be simplified by making each CryptoKey derived class override a function that returns the KeyAlgorithm variant. * crypto/CryptoKey.cpp: (WebCore::CryptoKey::algorithm const): Deleted. * crypto/CryptoKey.h: (WebCore::CryptoKey::extractable const): (WebCore::KeyAlgorithm::~KeyAlgorithm): Deleted. (WebCore::KeyAlgorithm::name const): Deleted. (WebCore::KeyAlgorithm::KeyAlgorithm): Deleted. * crypto/gcrypt/CryptoKeyRSAGCrypt.cpp: (WebCore::CryptoKeyRSA::algorithm const): (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted. * crypto/keys/CryptoKeyAES.cpp: (WebCore::CryptoKeyAES::algorithm const): (WebCore::AesKeyAlgorithm::dictionary const): Deleted. (WebCore::CryptoKeyAES::buildAlgorithm const): Deleted. * crypto/keys/CryptoKeyAES.h: * crypto/keys/CryptoKeyEC.cpp: (WebCore::CryptoKeyEC::algorithm const): (WebCore::EcKeyAlgorithm::dictionary const): Deleted. (WebCore::CryptoKeyEC::buildAlgorithm const): Deleted. * crypto/keys/CryptoKeyEC.h: (WebCore::EcKeyAlgorithm::EcKeyAlgorithm): Deleted. (WebCore::EcKeyAlgorithm::namedCurve const): Deleted. * crypto/keys/CryptoKeyHMAC.cpp: (WebCore::CryptoKeyHMAC::algorithm const): (WebCore::HmacKeyAlgorithm::dictionary const): Deleted. (WebCore::CryptoKeyHMAC::buildAlgorithm const): Deleted. * crypto/keys/CryptoKeyHMAC.h: * crypto/keys/CryptoKeyRSA.cpp: (WebCore::RsaKeyAlgorithm::dictionary const): Deleted. (WebCore::RsaHashedKeyAlgorithm::dictionary const): Deleted. * crypto/keys/CryptoKeyRSA.h: (WebCore::RsaKeyAlgorithm::RsaKeyAlgorithm): Deleted. (WebCore::RsaKeyAlgorithm::modulusLength const): Deleted. (WebCore::RsaKeyAlgorithm::publicExponent const): Deleted. * crypto/keys/CryptoKeyRaw.cpp: (WebCore::CryptoKeyRaw::algorithm const): (WebCore::RawKeyAlgorithm::dictionary const): Deleted. (WebCore::CryptoKeyRaw::buildAlgorithm const): Deleted. * crypto/keys/CryptoKeyRaw.h: (WebCore::RawKeyAlgorithm::RawKeyAlgorithm): Deleted. * crypto/mac/CryptoKeyRSAMac.cpp: (WebCore::CryptoKeyRSA::algorithm const): (WebCore::CryptoKeyRSA::buildAlgorithm const): Deleted. Canonical link: https://commits.webkit.org/192415@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@220954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
- Loading branch information
1 parent
08aeec6
commit b9f9e9c092a60cf3bf4385ee43f50f017148d483
Showing
15 changed files
with
139 additions
and
272 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.