Implement OEMCrypto_GetNumberOfOpenSessions

Merged from Widevine CDM repo:
https://widevine-internal-review.googlesource.com/#/c/13560/

Change-Id: Ie19bf3e57d0c4b1621b95bd5912a751ccfbaaa7b
This commit is contained in:
KongQun Yang
2015-03-11 09:37:21 -07:00
parent bd2ac27684
commit 46f26fe6ae
7 changed files with 57 additions and 10 deletions

View File

@@ -237,6 +237,8 @@ class CryptoEngine {
SessionContext* FindSession(SessionId sid);
size_t GetNumberOfOpenSessions() { return sessions_.size(); }
void set_current_session_(SessionContext* current) {
current_session_ = current;
}

View File

@@ -1024,6 +1024,16 @@ bool OEMCrypto_SupportsUsageTable() {
return supports_usage;
}
extern "C"
OEMCryptoResult OEMCrypto_GetNumberOfOpenSessions(size_t* count) {
if (LogCategoryEnabled(kLoggingTraceOEMCryptoCalls)) {
LOGI("-- OEMCryptoResult OEMCrypto_GetNumberOfOpenSessions(%p)\n", count);
}
if (count == NULL) return OEMCrypto_ERROR_UNKNOWN_FAILURE;
*count = crypto_engine->GetNumberOfOpenSessions();
return OEMCrypto_SUCCESS;
}
extern "C"
OEMCryptoResult OEMCrypto_GetMaxNumberOfSessions(size_t* maximum) {
if (LogCategoryEnabled(kLoggingTraceOEMCryptoCalls)) {