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

Unified Diff: content/renderer/media/crypto/proxy_media_keys.cc

Issue 1160983002: Allows support for persistent session types in BrowserCdm. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase conflicts with https://codereview.chromium.org/1166453002 Created 5 years, 7 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 | « content/common/media/cdm_messages.h ('k') | content/renderer/media/crypto/renderer_cdm_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/media/crypto/proxy_media_keys.cc
diff --git a/content/renderer/media/crypto/proxy_media_keys.cc b/content/renderer/media/crypto/proxy_media_keys.cc
index cec2e919e44a1e0265db9bc6f535fa016a3e2bef..a6408df498a6466a63f89a37fe86095b072a902e 100644
--- a/content/renderer/media/crypto/proxy_media_keys.cc
+++ b/content/renderer/media/crypto/proxy_media_keys.cc
@@ -60,12 +60,6 @@ void ProxyMediaKeys::CreateSessionAndGenerateRequest(
media::EmeInitDataType init_data_type,
const std::vector<uint8_t>& init_data,
scoped_ptr<media::NewSessionCdmPromise> promise) {
- if (session_type != media::MediaKeys::TEMPORARY_SESSION) {
- promise->reject(NOT_SUPPORTED_ERROR, 0,
- "Only the temporary session type is supported.");
- return;
- }
-
// TODO(xhwang): Move these checks up to blink and DCHECK here.
// See http://crbug.com/342510
CdmHostMsg_CreateSession_InitDataType create_session_init_data_type =
@@ -87,15 +81,16 @@ void ProxyMediaKeys::CreateSessionAndGenerateRequest(
uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass());
manager_->CreateSessionAndGenerateRequest(
- cdm_id_, promise_id, create_session_init_data_type, init_data);
+ cdm_id_, promise_id, session_type, create_session_init_data_type,
+ init_data);
}
void ProxyMediaKeys::LoadSession(
SessionType session_type,
const std::string& session_id,
scoped_ptr<media::NewSessionCdmPromise> promise) {
- NOTREACHED() << "ProxyMediaKeys doesn't support persistent sessions.";
- promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported.");
+ uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass());
+ manager_->LoadSession(cdm_id_, promise_id, session_type, session_id);
}
void ProxyMediaKeys::UpdateSession(
@@ -115,8 +110,8 @@ void ProxyMediaKeys::CloseSession(const std::string& session_id,
void ProxyMediaKeys::RemoveSession(
const std::string& session_id,
scoped_ptr<media::SimpleCdmPromise> promise) {
- NOTREACHED() << "ProxyMediaKeys doesn't support persistent sessions.";
- promise->reject(NOT_SUPPORTED_ERROR, 0, "RemoveSession() not supported.");
+ uint32_t promise_id = cdm_promise_adapter_.SavePromise(promise.Pass());
+ manager_->RemoveSession(cdm_id_, promise_id, session_id);
}
media::CdmContext* ProxyMediaKeys::GetCdmContext() {
« no previous file with comments | « content/common/media/cdm_messages.h ('k') | content/renderer/media/crypto/renderer_cdm_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698