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

Unified Diff: media/remoting/remoting_cdm_context.cc

Issue 2457563002: Media Remoting: Add remoting control logic for encrypted contents. (Closed)
Patch Set: Addressed comments from PS#12. Fixed ASAN. Created 4 years, 1 month 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/remoting/remoting_cdm_context.h ('k') | media/remoting/remoting_cdm_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/remoting/remoting_cdm_context.cc
diff --git a/media/remoting/remoting_cdm_context.cc b/media/remoting/remoting_cdm_context.cc
new file mode 100644
index 0000000000000000000000000000000000000000..dc6423c8768ee592389bc42be4794510d7c935f8
--- /dev/null
+++ b/media/remoting/remoting_cdm_context.cc
@@ -0,0 +1,47 @@
+// Copyright 2016 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "media/remoting/remoting_cdm_context.h"
+
+#include "media/remoting/remoting_cdm.h"
+#include "media/remoting/remoting_source_impl.h"
+
+namespace media {
+
+namespace {
+// Used as an identifier for RemotingCdmContext::From().
+void* const kClassIdentifier = const_cast<void**>(&kClassIdentifier);
+} // namespace
+
+// TODO(xjz): Merge this with erickung's implementation.
+RemotingCdmContext::RemotingCdmContext(RemotingCdm* remoting_cdm)
+ : remoting_cdm_(remoting_cdm) {}
+
+RemotingCdmContext::~RemotingCdmContext() {}
+
+RemotingCdmContext* RemotingCdmContext::From(CdmContext* cdm_context) {
+ if (cdm_context && cdm_context->GetClassIdentifier() == kClassIdentifier)
+ return static_cast<RemotingCdmContext*>(cdm_context);
+ return nullptr;
+}
+
+Decryptor* RemotingCdmContext::GetDecryptor() {
+ // TODO(xjz): Merge with erickung's implementation.
+ return nullptr;
+}
+
+int RemotingCdmContext::GetCdmId() const {
+ // TODO(xjz): Merge with erickung's implementation.
+ return CdmContext::kInvalidCdmId;
+}
+
+void* RemotingCdmContext::GetClassIdentifier() const {
+ return kClassIdentifier;
+}
+
+RemotingSourceImpl* RemotingCdmContext::GetRemotingSource() {
+ return remoting_cdm_->GetRemotingSource();
+}
+
+} // namespace media
« no previous file with comments | « media/remoting/remoting_cdm_context.h ('k') | media/remoting/remoting_cdm_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698