Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(758)

Unified Diff: media/cdm/ppapi/cdm_wrapper.h

Issue 497153005: ReleaseSession() should call RemoveSession() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: reorder Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/cdm/ppapi/cdm_adapter.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/ppapi/cdm_wrapper.h
diff --git a/media/cdm/ppapi/cdm_wrapper.h b/media/cdm/ppapi/cdm_wrapper.h
index 72afa90a029b2b06f972b71115d16d1f89f57d3f..f11672cadc33bf51632900c57f2581bd163be7d1 100644
--- a/media/cdm/ppapi/cdm_wrapper.h
+++ b/media/cdm/ppapi/cdm_wrapper.h
@@ -56,12 +56,14 @@ class CdmWrapper {
uint32_t web_session_id_size,
const uint8_t* response,
uint32_t response_size) = 0;
- virtual void CloseSession(uint32_t promise_id,
+ // TODO(jrummell): Remove return value when CDM4/5 are removed.
+ virtual bool CloseSession(uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) = 0;
- virtual bool RemoveSession(uint32_t promise_id,
+ virtual void RemoveSession(uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) = 0;
+ // TODO(jrummell): Remove return value when CDM4/5 are removed.
virtual bool GetUsableKeyIds(uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) = 0;
@@ -226,17 +228,17 @@ class CdmWrapperImpl : public CdmWrapper {
return true;
}
- virtual void CloseSession(uint32_t promise_id,
+ virtual bool CloseSession(uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) OVERRIDE {
cdm_->CloseSession(promise_id, web_session_id, web_session_id_size);
+ return true;
}
- virtual bool RemoveSession(uint32_t promise_id,
+ virtual void RemoveSession(uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) OVERRIDE {
cdm_->RemoveSession(promise_id, web_session_id, web_session_id_size);
- return true;
}
virtual void TimerExpired(void* context) OVERRIDE {
@@ -454,22 +456,22 @@ void CdmWrapperImpl<cdm::ContentDecryptionModule_4>::UpdateSession(
}
template <>
-void CdmWrapperImpl<cdm::ContentDecryptionModule_4>::CloseSession(
+bool CdmWrapperImpl<cdm::ContentDecryptionModule_4>::CloseSession(
uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) {
- std::string web_session_str(web_session_id, web_session_id_size);
- uint32_t session_id = LookupSessionId(web_session_str);
- RegisterPromise(session_id, promise_id);
- cdm_->ReleaseSession(session_id);
+ return false;
}
template <>
-bool CdmWrapperImpl<cdm::ContentDecryptionModule_4>::RemoveSession(
+void CdmWrapperImpl<cdm::ContentDecryptionModule_4>::RemoveSession(
uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) {
- return false;
+ std::string web_session_str(web_session_id, web_session_id_size);
+ uint32_t session_id = LookupSessionId(web_session_str);
+ RegisterPromise(session_id, promise_id);
+ cdm_->ReleaseSession(session_id);
}
template <>
@@ -572,19 +574,19 @@ void CdmWrapperImpl<cdm::ContentDecryptionModule_5>::UpdateSession(
}
template <>
-void CdmWrapperImpl<cdm::ContentDecryptionModule_5>::CloseSession(
+bool CdmWrapperImpl<cdm::ContentDecryptionModule_5>::CloseSession(
uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) {
- cdm_->ReleaseSession(promise_id, web_session_id, web_session_id_size);
+ return false;
}
template <>
-bool CdmWrapperImpl<cdm::ContentDecryptionModule_5>::RemoveSession(
+void CdmWrapperImpl<cdm::ContentDecryptionModule_5>::RemoveSession(
uint32_t promise_id,
const char* web_session_id,
uint32_t web_session_id_size) {
- return false;
+ cdm_->ReleaseSession(promise_id, web_session_id, web_session_id_size);
}
template <>
« no previous file with comments | « media/cdm/ppapi/cdm_adapter.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698