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

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

Issue 171073002: Move SessionIdAdapter out of WebContentDecryptionModuleImpl (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: content/renderer/media/webcontentdecryptionmodulesession_impl.cc
diff --git a/content/renderer/media/webcontentdecryptionmodulesession_impl.cc b/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
index f9f0b55eb812a992f87a8a14a077d19a3efba709..20830f035fcd82f2bb69290257d76cb625fecd6c 100644
--- a/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
+++ b/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
@@ -7,20 +7,19 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
+#include "content/renderer/media/cdm_session_id_adapter.h"
#include "third_party/WebKit/public/platform/WebURL.h"
namespace content {
WebContentDecryptionModuleSessionImpl::WebContentDecryptionModuleSessionImpl(
uint32 session_id,
- media::MediaKeys* media_keys,
Client* client,
- const SessionClosedCB& session_closed_cb)
- : media_keys_(media_keys),
+ scoped_refptr<CdmSessionIdAdapter> adapter)
+ : adapter_(adapter),
client_(client),
- session_closed_cb_(session_closed_cb),
session_id_(session_id) {
- DCHECK(media_keys_);
+ adapter_->AddSession(session_id, this);
}
WebContentDecryptionModuleSessionImpl::
@@ -42,18 +41,18 @@ void WebContentDecryptionModuleSessionImpl::initializeNewSession(
return;
}
- media_keys_->CreateSession(
+ adapter_->CreateSession(
ddorwin 2014/02/18 20:59:42 It really is the CDM interface! All the more reaso
session_id_, UTF16ToASCII(mime_type), init_data, init_data_length);
}
void WebContentDecryptionModuleSessionImpl::update(const uint8* response,
size_t response_length) {
DCHECK(response);
- media_keys_->UpdateSession(session_id_, response, response_length);
+ adapter_->UpdateSession(session_id_, response, response_length);
}
void WebContentDecryptionModuleSessionImpl::release() {
- media_keys_->ReleaseSession(session_id_);
+ adapter_->ReleaseSession(session_id_);
}
void WebContentDecryptionModuleSessionImpl::OnSessionCreated(
@@ -83,8 +82,7 @@ void WebContentDecryptionModuleSessionImpl::OnSessionReady() {
void WebContentDecryptionModuleSessionImpl::OnSessionClosed() {
client_->close();
- if (!session_closed_cb_.is_null())
- base::ResetAndReturn(&session_closed_cb_).Run(session_id_);
+ adapter_->RemoveSession(session_id_);
}
void WebContentDecryptionModuleSessionImpl::OnSessionError(

Powered by Google App Engine
This is Rietveld 408576698