From e94fe096ed8c20a9388c6b321dc20a4b3eaa0a34 Mon Sep 17 00:00:00 2001 From: davidben Date: Fri, 20 Feb 2015 16:51:33 -0800 Subject: Convert crypto::ScopedOpenSSL to type aliases. This avoids having to put '::Type' everywhere. BUG=none Review URL: https://codereview.chromium.org/948543002 Cr-Commit-Position: refs/heads/master@{#317462} --- crypto/scoped_openssl_types.h | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) (limited to 'crypto/scoped_openssl_types.h') diff --git a/crypto/scoped_openssl_types.h b/crypto/scoped_openssl_types.h index 87e0f94..b392a07 100644 --- a/crypto/scoped_openssl_types.h +++ b/crypto/scoped_openssl_types.h @@ -22,15 +22,13 @@ namespace crypto { // base::internal::RunnableAdapter<>, but that's far too heavy weight. template struct OpenSSLDestroyer { - typedef void AllowSelfReset; + using AllowSelfReset = void; void operator()(Type* ptr) const { Destroyer(ptr); } }; template -struct ScopedOpenSSL { - typedef scoped_ptr > - Type; -}; +using ScopedOpenSSL = + scoped_ptr>; struct OpenSSLFree { void operator()(uint8_t* ptr) const { OPENSSL_free(ptr); } @@ -40,21 +38,21 @@ struct OpenSSLFree { // short-hand and prevalence. Note that OpenSSL types related to X.509 are // intentionally not included, as crypto/ does not generally deal with // certificates or PKI. -typedef ScopedOpenSSL::Type ScopedBIGNUM; -typedef ScopedOpenSSL::Type ScopedEC_KEY; -typedef ScopedOpenSSL::Type ScopedBIO; -typedef ScopedOpenSSL::Type ScopedDSA; -typedef ScopedOpenSSL::Type ScopedECDSA_SIG; -typedef ScopedOpenSSL::Type ScopedEC_GROUP; -typedef ScopedOpenSSL::Type ScopedEC_KEY; -typedef ScopedOpenSSL::Type ScopedEC_POINT; -typedef ScopedOpenSSL::Type ScopedEVP_MD_CTX; -typedef ScopedOpenSSL::Type ScopedEVP_PKEY; -typedef ScopedOpenSSL::Type ScopedEVP_PKEY_CTX; -typedef ScopedOpenSSL::Type ScopedRSA; +using ScopedBIGNUM = ScopedOpenSSL; +using ScopedEC_Key = ScopedOpenSSL; +using ScopedBIO = ScopedOpenSSL; +using ScopedDSA = ScopedOpenSSL; +using ScopedECDSA_SIG = ScopedOpenSSL; +using ScopedEC_GROUP = ScopedOpenSSL; +using ScopedEC_KEY = ScopedOpenSSL; +using ScopedEC_POINT = ScopedOpenSSL; +using ScopedEVP_MD_CTX = ScopedOpenSSL; +using ScopedEVP_PKEY = ScopedOpenSSL; +using ScopedEVP_PKEY_CTX = ScopedOpenSSL; +using ScopedRSA = ScopedOpenSSL; // The bytes must have been allocated with OPENSSL_malloc. -typedef scoped_ptr ScopedOpenSSLBytes; +using ScopedOpenSSLBytes = scoped_ptr; } // namespace crypto -- cgit v1.1