From 952b571a4ac7800f1fb6390957d54933c6d4d762 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= Date: Thu, 9 May 2019 12:57:02 +0200 Subject: [PATCH] Delete unused class InsecureCryptStringImpl Bug: webrtc:6424 Change-Id: I966715f3d815d85b3ec46333cea80418944cd4b1 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/135742 Reviewed-by: Benjamin Wright Reviewed-by: Steve Anton Commit-Queue: Niels Moller Cr-Commit-Position: refs/heads/master@{#27902} --- rtc_base/crypt_string.cc | 26 -------------------------- rtc_base/crypt_string.h | 16 ---------------- 2 files changed, 42 deletions(-) diff --git a/rtc_base/crypt_string.cc b/rtc_base/crypt_string.cc index ed0ff163ba..cf38a5bbaa 100644 --- a/rtc_base/crypt_string.cc +++ b/rtc_base/crypt_string.cc @@ -43,30 +43,4 @@ CryptString::CryptString(const CryptStringImpl& impl) : impl_(impl.Copy()) {} CryptString::~CryptString() = default; -size_t InsecureCryptStringImpl::GetLength() const { - return password_.size(); -} - -void InsecureCryptStringImpl::CopyTo(char* dest, bool nullterminate) const { - memcpy(dest, password_.data(), password_.size()); - if (nullterminate) - dest[password_.size()] = 0; -} - -std::string InsecureCryptStringImpl::UrlEncode() const { - return password_; -} - -CryptStringImpl* InsecureCryptStringImpl::Copy() const { - InsecureCryptStringImpl* copy = new InsecureCryptStringImpl; - copy->password() = password_; - return copy; -} - -void InsecureCryptStringImpl::CopyRawTo( - std::vector* dest) const { - dest->resize(password_.size()); - memcpy(&dest->front(), password_.data(), password_.size()); -} - } // namespace rtc diff --git a/rtc_base/crypt_string.h b/rtc_base/crypt_string.h index 8aa757cdb5..470bd00c42 100644 --- a/rtc_base/crypt_string.h +++ b/rtc_base/crypt_string.h @@ -65,22 +65,6 @@ class CryptString { std::unique_ptr impl_; }; -class InsecureCryptStringImpl : public CryptStringImpl { - public: - std::string& password() { return password_; } - const std::string& password() const { return password_; } - - ~InsecureCryptStringImpl() override = default; - size_t GetLength() const override; - void CopyTo(char* dest, bool nullterminate) const override; - std::string UrlEncode() const override; - CryptStringImpl* Copy() const override; - void CopyRawTo(std::vector* dest) const override; - - private: - std::string password_; -}; - } // namespace rtc #endif // RTC_BASE_CRYPT_STRING_H_