Index: media/remoting/remoting_cdm.h |
diff --git a/media/remoting/remoting_cdm.h b/media/remoting/remoting_cdm.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..74e9330db16e387bcfc3a9e52f7396bf093aee3f |
--- /dev/null |
+++ b/media/remoting/remoting_cdm.h |
@@ -0,0 +1,68 @@ |
+// 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. |
+ |
+#ifndef MEDIA_REMOTING_REMOTING_CDM_H_ |
+#define MEDIA_REMOTING_REMOTING_CDM_H_ |
+ |
+#include "media/base/cdm_context.h" |
+#include "media/base/cdm_factory.h" |
+#include "media/base/media_keys.h" |
+#include "media/remoting/remoting_cdm_controller.h" |
+ |
+namespace media { |
+ |
+// TODO(xjz): Merge this with Eric's implementation. |
+class RemotingCdm : public MediaKeys, public CdmContext { |
+ public: |
+ RemotingCdm(const std::string& key_system, |
+ const GURL& security_origin, |
+ const CdmConfig& cdm_config, |
+ const SessionMessageCB& session_message_cb, |
+ const SessionClosedCB& session_closed_cb, |
+ const SessionKeysChangeCB& session_keys_change_cb, |
+ const SessionExpirationUpdateCB& session_expiration_update_cb, |
+ const CdmCreatedCB& cdm_created_cb, |
+ std::unique_ptr<RemotingCdmController> remoting_controller); |
+ |
+ // If |cdm| is an instance of RemotingCdm, return a type-casted pointer to it. |
+ // Otherwise, return nullptr. |
+ static RemotingCdm* From(CdmContext* cdm); |
+ |
+ scoped_refptr<RemotingSourceImpl> GetRemotingSource(); |
miu
2016/10/25 04:21:25
General scoped_refptr usage note: The return type
xjz
2016/10/26 22:00:25
Done.
|
+ |
+ // MediaKeys implementations. |
+ void SetServerCertificate(const std::vector<uint8_t>& certificate, |
+ std::unique_ptr<SimpleCdmPromise> promise) override; |
+ void CreateSessionAndGenerateRequest( |
+ SessionType session_type, |
+ EmeInitDataType init_data_type, |
+ const std::vector<uint8_t>& init_data, |
+ std::unique_ptr<NewSessionCdmPromise> promise) override; |
+ void LoadSession(SessionType session_type, |
+ const std::string& session_id, |
+ std::unique_ptr<NewSessionCdmPromise> promise) override; |
+ void UpdateSession(const std::string& session_id, |
+ const std::vector<uint8_t>& response, |
+ std::unique_ptr<SimpleCdmPromise> promise) override; |
+ void CloseSession(const std::string& session_id, |
+ std::unique_ptr<SimpleCdmPromise> promise) override; |
+ void RemoveSession(const std::string& session_id, |
+ std::unique_ptr<SimpleCdmPromise> promise) override; |
+ CdmContext* GetCdmContext() override; |
+ |
+ // CdmContext implementations. |
+ Decryptor* GetDecryptor() override; |
+ int GetCdmId() const override; |
+ void* GetClassIdentifier() const override; |
+ |
+ private: |
+ ~RemotingCdm() override; |
+ std::unique_ptr<RemotingCdmController> remoting_controller_; |
miu
2016/10/25 04:21:25
const
xjz
2016/10/26 22:00:25
Done.
|
+ |
+ DISALLOW_COPY_AND_ASSIGN(RemotingCdm); |
+}; |
+ |
+} // namespace media |
+ |
+#endif // MEDIA_REMOTING_REMOTING_CDM_H_ |