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

Unified Diff: media/cdm/ppapi/cdm_adapter.cc

Issue 131653003: Support LoadSession() in MediaKeys and PPP_ContentDecryptor_Private interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: comments addressed Created 6 years, 10 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.h ('k') | media/cdm/ppapi/cdm_wrapper.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/ppapi/cdm_adapter.cc
diff --git a/media/cdm/ppapi/cdm_adapter.cc b/media/cdm/ppapi/cdm_adapter.cc
index 3fe1fad131bf541085e81c54b8ce1e78dbd033a4..603472f377984b47fd05bf61150f76e9b726ea72 100644
--- a/media/cdm/ppapi/cdm_adapter.cc
+++ b/media/cdm/ppapi/cdm_adapter.cc
@@ -248,9 +248,13 @@ bool CdmAdapter::CreateCdmInstance(const std::string& key_system) {
return success;
}
-// No KeyErrors should be reported in this function because they cannot be
-// bubbled up in the WD EME API. Those errors will be reported during session
-// creation (CreateSession).
+// No errors should be reported in this function because the spec says:
+// "Store this new error object internally with the MediaKeys instance being
+// created. This will be used to fire an error against any session created for
+// this instance." These errors will be reported during session creation
+// (CreateSession()) or session loading (LoadSession()).
+// TODO(xhwang): If necessary, we need to store the error here if we want to
+// support more delicate error reporting (other than "Unknown").
ddorwin 2014/02/10 23:26:24 delicate? Maybe specific?
xhwang 2014/02/10 23:42:34 Done.
xhwang 2014/02/10 23:42:34 Done.
void CdmAdapter::Initialize(const std::string& key_system) {
PP_DCHECK(!key_system.empty());
PP_DCHECK(key_system_.empty() || (key_system_ == key_system && cdm_));
@@ -263,7 +267,7 @@ void CdmAdapter::Initialize(const std::string& key_system) {
}
void CdmAdapter::CreateSession(uint32_t session_id,
- const std::string& type,
+ const std::string& content_type,
pp::VarArrayBuffer init_data) {
// Initialize() doesn't report an error, so CreateSession() can be called
// even if Initialize() failed.
@@ -288,12 +292,26 @@ void CdmAdapter::CreateSession(uint32_t session_id,
#endif // defined(CHECK_DOCUMENT_URL)
cdm_->CreateSession(session_id,
- type.data(),
- type.size(),
+ content_type.data(),
+ content_type.size(),
static_cast<const uint8_t*>(init_data.Map()),
init_data.ByteLength());
}
+void CdmAdapter::LoadSession(uint32_t session_id,
+ const std::string& web_session_id) {
+ // Initialize() doesn't report an error, so LoadSession() can be called
+ // even if Initialize() failed.
+ if (!cdm_) {
+ OnSessionError(session_id, cdm::kUnknownError, 0);
+ return;
+ }
+
+ if (!cdm_->LoadSession(
+ session_id, web_session_id.data(), web_session_id.size()))
+ OnSessionError(session_id, cdm::kUnknownError, 0);
+}
+
void CdmAdapter::UpdateSession(uint32_t session_id,
pp::VarArrayBuffer response) {
// TODO(jrummell): In EME WD, AddKey() can only be called on valid sessions.
« no previous file with comments | « media/cdm/ppapi/cdm_adapter.h ('k') | media/cdm/ppapi/cdm_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698