Replace typedef with using statement in cdm/core/ files.

[ Merge of http://go/wvgerrit/80805 ]

This change was used only where `typedef` was used for type aliasing,
and not for defining a new type (such as enums, structs, or function
pointer types).

Clang-format was used on the changed files.

Test: WV unit tests
Bug: 134437705
Change-Id: I730b9709a5ac773b3036daa79024caab665b3daa
This commit is contained in:
Alex Dale
2019-06-07 11:15:42 -07:00
parent a178eed57d
commit ce0ea7b20b
10 changed files with 56 additions and 56 deletions

View File

@@ -33,8 +33,8 @@ class UsagePropertySet;
class WvCdmEventListener; class WvCdmEventListener;
// Keep expiration time for each key set // Keep expiration time for each key set
typedef std::map<CdmKeySetId, std::pair<CdmSessionId, int64_t> > using CdmReleaseKeySetMap =
CdmReleaseKeySetMap; std::map<CdmKeySetId, std::pair<CdmSessionId, int64_t> >;
class CdmEngine { class CdmEngine {
public: public:

View File

@@ -15,7 +15,7 @@
namespace wvcdm { namespace wvcdm {
typedef std::list<std::shared_ptr<CdmSession> > CdmSessionList; using CdmSessionList = std::list<std::shared_ptr<CdmSession> >;
// TODO(rfrias): Concurrency protection for this class has moved to CdmEngine. // TODO(rfrias): Concurrency protection for this class has moved to CdmEngine.
// Add it back when locks to control access to session usage and destruction // Add it back when locks to control access to session usage and destruction
@@ -43,8 +43,8 @@ class CdmSessionMap {
void GetSessionList(CdmSessionList& sessions); void GetSessionList(CdmSessionList& sessions);
private: private:
typedef std::map<CdmSessionId, std::shared_ptr<CdmSession> > using CdmIdToSessionMap =
CdmIdToSessionMap; std::map<CdmSessionId, std::shared_ptr<CdmSession> >;
bool FindSessionNoLock(const CdmSessionId& session_id, bool FindSessionNoLock(const CdmSessionId& session_id,
std::shared_ptr<CdmSession>* session); std::shared_ptr<CdmSession>* session);

View File

@@ -26,7 +26,7 @@ namespace wvcdm {
class CryptoKey; class CryptoKey;
class UsageTableHeader; class UsageTableHeader;
typedef std::map<std::string, CryptoKey*> CryptoKeyMap; using CryptoKeyMap = std::map<std::string, CryptoKey*>;
// Crypto session utility functions used by KeySession implementations. // Crypto session utility functions used by KeySession implementations.
void GenerateMacContext(const std::string& input_context, void GenerateMacContext(const std::string& input_context,
@@ -43,7 +43,7 @@ class CryptoSessionFactory;
class CryptoSession { class CryptoSession {
public: public:
typedef OEMCrypto_HDCP_Capability HdcpCapability; using HdcpCapability = OEMCrypto_HDCP_Capability;
typedef enum { typedef enum {
kUsageDurationsInvalid = 0, kUsageDurationsInvalid = 0,
kUsageDurationPlaybackNotBegun = 1, kUsageDurationPlaybackNotBegun = 1,

View File

@@ -77,9 +77,9 @@ class LicenseKeys {
} }
private: private:
typedef ::video_widevine::License::KeyContainer KeyContainer; using KeyContainer = ::video_widevine::License::KeyContainer;
typedef std::map<wvcdm::KeyId, LicenseKeyStatus*>::const_iterator using LicenseKeyStatusIterator =
LicenseKeyStatusIterator; std::map<wvcdm::KeyId, LicenseKeyStatus*>::const_iterator;
void Clear(); void Clear();
@@ -135,13 +135,13 @@ class LicenseKeyStatus {
CryptoSession::HdcpCapability new_hdcp_level); CryptoSession::HdcpCapability new_hdcp_level);
protected: protected:
typedef ::video_widevine::License::KeyContainer KeyContainer; using KeyContainer = ::video_widevine::License::KeyContainer;
typedef KeyContainer::OperatorSessionKeyPermissions using OperatorSessionKeyPermissions =
OperatorSessionKeyPermissions; KeyContainer::OperatorSessionKeyPermissions;
typedef KeyContainer::OutputProtection OutputProtection; using OutputProtection = KeyContainer::OutputProtection;
typedef KeyContainer::VideoResolutionConstraint VideoResolutionConstraint; using VideoResolutionConstraint = KeyContainer::VideoResolutionConstraint;
typedef ::google::protobuf::RepeatedPtrField<VideoResolutionConstraint> using ConstraintList =
ConstraintList; ::google::protobuf::RepeatedPtrField<VideoResolutionConstraint>;
LicenseKeyStatus(const KeyContainer& key, const CdmSecurityLevel level); LicenseKeyStatus(const KeyContainer& key, const CdmSecurityLevel level);

View File

@@ -20,7 +20,7 @@
namespace wvcdm { namespace wvcdm {
typedef std::map<CdmSessionId, CdmClientPropertySet*> CdmClientPropertySetMap; using CdmClientPropertySetMap = std::map<CdmSessionId, CdmClientPropertySet*>;
// This class saves information about features and properties enabled // This class saves information about features and properties enabled
// for a given platform. At initialization it initializes properties from // for a given platform. At initialization it initializes properties from

View File

@@ -14,25 +14,25 @@
namespace wvcdm { namespace wvcdm {
typedef std::string CdmKeySystem; using CdmKeySystem = std::string;
typedef std::string CdmInitData; using CdmInitData = std::string;
typedef std::string CdmKeyMessage; using CdmKeyMessage = std::string;
typedef std::string CdmKeyResponse; using CdmKeyResponse = std::string;
typedef std::string KeyId; using KeyId = std::string;
typedef std::string CdmSecureStopId; using CdmSecureStopId = std::string;
typedef std::string CdmSessionId; using CdmSessionId = std::string;
typedef std::string CdmKeySetId; using CdmKeySetId = std::string;
typedef std::string RequestId; using RequestId = std::string;
typedef uint32_t CryptoResult; using CryptoResult = uint32_t;
typedef uint32_t CryptoSessionId; using CryptoSessionId = uint32_t;
typedef std::map<std::string, std::string> CdmAppParameterMap; using CdmAppParameterMap = std::map<std::string, std::string>;
typedef std::map<std::string, std::string> CdmQueryMap; using CdmQueryMap = std::map<std::string, std::string>;
typedef std::vector<std::string> CdmUsageInfo; using CdmUsageInfo = std::vector<std::string>;
typedef std::string CdmUsageInfoReleaseMessage; using CdmUsageInfoReleaseMessage = std::string;
typedef std::string CdmProvisioningRequest; using CdmProvisioningRequest = std::string;
typedef std::string CdmProvisioningResponse; using CdmProvisioningResponse = std::string;
typedef std::string CdmUsageTableHeader; using CdmUsageTableHeader = std::string;
typedef std::string CdmUsageEntry; using CdmUsageEntry = std::string;
enum CdmKeyRequestType { enum CdmKeyRequestType {
kKeyRequestTypeUnknown, kKeyRequestTypeUnknown,
@@ -411,7 +411,7 @@ enum CdmKeyStatus {
kKeyStatusInternalError, kKeyStatusInternalError,
kKeyStatusUsableInFuture, kKeyStatusUsableInFuture,
}; };
typedef std::map<KeyId, CdmKeyStatus> CdmKeyStatusMap; using CdmKeyStatusMap = std::map<KeyId, CdmKeyStatus>;
enum CdmLicenseType { enum CdmLicenseType {
kLicenseTypeOffline, kLicenseTypeOffline,

View File

@@ -11,11 +11,11 @@
namespace { namespace {
// License protocol aliases // License protocol aliases
typedef ::video_widevine::License::KeyContainer KeyContainer; using KeyContainer = ::video_widevine::License::KeyContainer;
typedef KeyContainer::OutputProtection OutputProtection; using OutputProtection = KeyContainer::OutputProtection;
typedef KeyContainer::VideoResolutionConstraint VideoResolutionConstraint; using VideoResolutionConstraint = KeyContainer::VideoResolutionConstraint;
typedef ::google::protobuf::RepeatedPtrField<VideoResolutionConstraint> using ConstraintList =
ConstraintList; ::google::protobuf::RepeatedPtrField<VideoResolutionConstraint>;
// Map the HDCP protection associated with a key in the license to // Map the HDCP protection associated with a key in the license to
// an equivalent OEMCrypto HDCP protection level // an equivalent OEMCrypto HDCP protection level
@@ -49,7 +49,7 @@ wvcdm::CryptoSession::HdcpCapability ProtobufHdcpToOemCryptoHdcp(
// specified resolution, or null if none match // specified resolution, or null if none match
VideoResolutionConstraint* GetConstraintForRes( VideoResolutionConstraint* GetConstraintForRes(
uint32_t res, ConstraintList& constraints_from_key) { uint32_t res, ConstraintList& constraints_from_key) {
typedef ConstraintList::pointer_iterator Iterator; using Iterator = ConstraintList::pointer_iterator;
for (Iterator i = constraints_from_key.pointer_begin(); for (Iterator i = constraints_from_key.pointer_begin();
i != constraints_from_key.pointer_end(); ++i) { i != constraints_from_key.pointer_end(); ++i) {
VideoResolutionConstraint* constraint = *i; VideoResolutionConstraint* constraint = *i;

View File

@@ -590,7 +590,7 @@ struct LevelSession {
// 3 function pointers. The Adapter is a global singleton. // 3 function pointers. The Adapter is a global singleton.
class Adapter { class Adapter {
public: public:
typedef std::map<OEMCrypto_SESSION, LevelSession>::iterator map_iterator; using map_iterator = std::map<OEMCrypto_SESSION, LevelSession>::iterator;
Adapter() : level1_valid_(false), level1_library_(NULL) {} Adapter() : level1_valid_(false), level1_library_(NULL) {}

View File

@@ -67,8 +67,8 @@ using video_widevine::LicenseIdentification;
using video_widevine::STREAMING; using video_widevine::STREAMING;
using video_widevine::OFFLINE; using video_widevine::OFFLINE;
typedef ::video_widevine::License::KeyContainer KeyContainer; using KeyContainer = ::video_widevine::License::KeyContainer;
typedef KeyContainer::VideoResolutionConstraint VideoResolutionConstraint; using VideoResolutionConstraint = KeyContainer::VideoResolutionConstraint;
class LicenseKeysTest : public ::testing::Test { class LicenseKeysTest : public ::testing::Test {
protected: protected:

View File

@@ -24,15 +24,15 @@ using video_widevine::STREAMING;
namespace wvcdm { namespace wvcdm {
typedef ::video_widevine::License License; using License = ::video_widevine::License;
typedef ::video_widevine::License::KeyContainer KeyContainer; using KeyContainer = ::video_widevine::License::KeyContainer;
typedef ::video_widevine::License::KeyContainer::OutputProtection using OutputProtection =
OutputProtection; ::video_widevine::License::KeyContainer::OutputProtection;
typedef ::video_widevine::License::KeyContainer:: using VideoResolutionConstraint =
VideoResolutionConstraint VideoResolutionConstraint; ::video_widevine::License::KeyContainer::VideoResolutionConstraint;
typedef ::google::protobuf::RepeatedPtrField<KeyContainer> KeyList; using KeyList = ::google::protobuf::RepeatedPtrField<KeyContainer>;
typedef ::google::protobuf::RepeatedPtrField<VideoResolutionConstraint> using ConstraintList =
ConstraintList; ::google::protobuf::RepeatedPtrField<VideoResolutionConstraint>;
using namespace testing; using namespace testing;