Source release v2.1.2-0-773 + third_party libs
Change-Id: Ia07608577b65b301c22a8ff4bf7f743c2d3f9274
This commit is contained in:
@@ -5,6 +5,10 @@
|
||||
|
||||
#include "wv_cdm_types.h"
|
||||
|
||||
#if defined(UNIT_TEST)
|
||||
#include <gtest/gtest_prod.h>
|
||||
#endif
|
||||
|
||||
namespace wvcdm {
|
||||
|
||||
class File;
|
||||
@@ -18,10 +22,10 @@ class DeviceFiles {
|
||||
} LicenseState;
|
||||
|
||||
DeviceFiles(): file_(NULL), security_level_(kSecurityLevelUninitialized),
|
||||
initialized_(false) {}
|
||||
virtual ~DeviceFiles() {}
|
||||
initialized_(false), test_file_(false) {}
|
||||
virtual ~DeviceFiles();
|
||||
|
||||
virtual bool Init(const File* handle, CdmSecurityLevel security_level);
|
||||
virtual bool Init(CdmSecurityLevel security_level);
|
||||
|
||||
virtual bool StoreCertificate(const std::string& certificate,
|
||||
const std::string& wrapped_private_key);
|
||||
@@ -49,25 +53,52 @@ class DeviceFiles {
|
||||
virtual bool DeleteAllLicenses();
|
||||
virtual bool LicenseExists(const std::string& key_set_id);
|
||||
|
||||
// For testing only
|
||||
static std::string GetCertificateFileName();
|
||||
static std::string GetLicenseFileNameExtension();
|
||||
|
||||
protected:
|
||||
bool Hash(const std::string& data, std::string* hash);
|
||||
bool StoreFile(const char* name, const std::string& data);
|
||||
bool RetrieveFile(const char* name, std::string* data);
|
||||
virtual bool StoreUsageInfo(const std::string& provider_session_token,
|
||||
const CdmKeyMessage& key_request,
|
||||
const CdmKeyResponse& key_response);
|
||||
virtual bool DeleteUsageInfo(const std::string& provider_session_token);
|
||||
virtual bool DeleteUsageInfo();
|
||||
virtual bool RetrieveUsageInfo(
|
||||
std::vector<std::pair<CdmKeyMessage, CdmKeyResponse> >* usage_info);
|
||||
|
||||
private:
|
||||
bool StoreFile(const char* name, const std::string& serialized_file);
|
||||
bool RetrieveFile(const char* name, std::string* serialized_file);
|
||||
|
||||
// Certificate and offline licenses are now stored in security
|
||||
// level specific directories. In an earlier version they were
|
||||
// stored in a common directory and need to be copied over.
|
||||
virtual void SecurityLevelPathBackwardCompatibility();
|
||||
|
||||
// For testing only:
|
||||
static std::string GetCertificateFileName();
|
||||
static std::string GetLicenseFileNameExtension();
|
||||
static std::string GetUsageInfoFileName();
|
||||
void SetTestFile(File* file);
|
||||
#if defined(UNIT_TEST)
|
||||
FRIEND_TEST(DeviceFilesSecurityLevelTest, SecurityLevel);
|
||||
FRIEND_TEST(DeviceFilesStoreTest, StoreCertificate);
|
||||
FRIEND_TEST(DeviceFilesStoreTest, StoreLicense);
|
||||
FRIEND_TEST(DeviceFilesTest, DeleteLicense);
|
||||
FRIEND_TEST(DeviceFilesTest, ReadCertificate);
|
||||
FRIEND_TEST(DeviceFilesTest, RetrieveLicenses);
|
||||
FRIEND_TEST(DeviceFilesTest, SecurityLevelPathBackwardCompatibility);
|
||||
FRIEND_TEST(DeviceFilesTest, StoreLicenses);
|
||||
FRIEND_TEST(DeviceFilesTest, UpdateLicenseState);
|
||||
FRIEND_TEST(DeviceFilesUsageInfoTest, Delete);
|
||||
FRIEND_TEST(DeviceFilesUsageInfoTest, Read);
|
||||
FRIEND_TEST(DeviceFilesUsageInfoTest, Store);
|
||||
FRIEND_TEST(WvCdmRequestLicenseTest, UnprovisionTest);
|
||||
FRIEND_TEST(WvCdmRequestLicenseTest, ForceL3Test);
|
||||
FRIEND_TEST(WvCdmUsageInfoTest, DISABLED_UsageInfo);
|
||||
#endif
|
||||
|
||||
File* file_;
|
||||
CdmSecurityLevel security_level_;
|
||||
bool initialized_;
|
||||
|
||||
bool test_file_;
|
||||
|
||||
CORE_DISALLOW_COPY_AND_ASSIGN(DeviceFiles);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user