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

Unified Diff: content/renderer/media/cdm_session_adapter.cc

Issue 193523002: Encrypted Media: Implement IPC based SetCdm(). (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase only Created 6 years, 9 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
Index: content/renderer/media/cdm_session_adapter.cc
diff --git a/content/renderer/media/cdm_session_adapter.cc b/content/renderer/media/cdm_session_adapter.cc
index b77cb3805dd58da15d8dd0097ba28b08925ae890..473a53b48fc382668477da51b70fe7809ebe8383 100644
--- a/content/renderer/media/cdm_session_adapter.cc
+++ b/content/renderer/media/cdm_session_adapter.cc
@@ -19,14 +19,18 @@ uint32 CdmSessionAdapter::next_session_id_ = kStartingSessionId;
COMPILE_ASSERT(kStartingSessionId > media::MediaKeys::kInvalidSessionId,
invalid_starting_value);
-CdmSessionAdapter::CdmSessionAdapter() : weak_ptr_factory_(this) {}
+CdmSessionAdapter::CdmSessionAdapter() :
+#if defined(OS_ANDROID)
+ cdm_id_(0),
+#endif
+ weak_ptr_factory_(this) {}
CdmSessionAdapter::~CdmSessionAdapter() {}
bool CdmSessionAdapter::Initialize(
#if defined(ENABLE_PEPPER_CDMS)
const CreatePepperCdmCB& create_pepper_cdm_cb,
-#endif
+#endif // defined(ENABLE_PEPPER_CDMS)
const std::string& key_system) {
base::WeakPtr<CdmSessionAdapter> weak_this = weak_ptr_factory_.GetWeakPtr();
media_keys_ =
@@ -37,9 +41,9 @@ bool CdmSessionAdapter::Initialize(
#elif defined(OS_ANDROID)
// TODO(xhwang): Support Android.
NULL,
- 0,
// TODO(ddorwin): Get the URL for the frame containing the MediaKeys.
GURL(),
+ &cdm_id_,
#endif // defined(ENABLE_PEPPER_CDMS)
base::Bind(&CdmSessionAdapter::OnSessionCreated, weak_this),
base::Bind(&CdmSessionAdapter::OnSessionMessage, weak_this),
@@ -92,6 +96,12 @@ media::Decryptor* CdmSessionAdapter::GetDecryptor() {
return media_keys_->GetDecryptor();
}
+#if defined(OS_ANDROID)
+int CdmSessionAdapter::GetCdmId() const {
+ return cdm_id_;
+}
+#endif // defined(OS_ANDROID)
+
void CdmSessionAdapter::OnSessionCreated(uint32 session_id,
const std::string& web_session_id) {
WebContentDecryptionModuleSessionImpl* session = GetSession(session_id);

Powered by Google App Engine
This is Rietveld 408576698