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

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: const refptr 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 | « content/renderer/media/webcontentdecryptionmodulesession_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6a3935e36e51686b0977fb1dfe1fc818a1d667b0 100644
--- a/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
+++ b/content/renderer/media/webcontentdecryptionmodulesession_impl.cc
@@ -7,24 +7,23 @@
#include "base/callback_helpers.h"
#include "base/logging.h"
#include "base/strings/string_util.h"
+#include "content/renderer/media/cdm_session_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),
+ const scoped_refptr<CdmSessionAdapter>& adapter)
+ : adapter_(adapter),
client_(client),
- session_closed_cb_(session_closed_cb),
session_id_(session_id) {
- DCHECK(media_keys_);
}
WebContentDecryptionModuleSessionImpl::
-~WebContentDecryptionModuleSessionImpl() {
+ ~WebContentDecryptionModuleSessionImpl() {
+ adapter_->RemoveSession(session_id_);
}
blink::WebString WebContentDecryptionModuleSessionImpl::sessionId() const {
@@ -42,18 +41,18 @@ void WebContentDecryptionModuleSessionImpl::initializeNewSession(
return;
}
- media_keys_->CreateSession(
+ adapter_->InitializeNewSession(
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,6 @@ void WebContentDecryptionModuleSessionImpl::OnSessionReady() {
void WebContentDecryptionModuleSessionImpl::OnSessionClosed() {
client_->close();
- if (!session_closed_cb_.is_null())
- base::ResetAndReturn(&session_closed_cb_).Run(session_id_);
}
void WebContentDecryptionModuleSessionImpl::OnSessionError(
« no previous file with comments | « content/renderer/media/webcontentdecryptionmodulesession_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698