Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ | 5 #ifndef MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ |
| 6 #define MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ | 6 #define MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 21 #include "media/base/media_keys.h" | 21 #include "media/base/media_keys.h" |
| 22 #include "media/mojo/interfaces/content_decryption_module.mojom.h" | 22 #include "media/mojo/interfaces/content_decryption_module.mojom.h" |
| 23 #include "mojo/public/cpp/bindings/binding.h" | 23 #include "mojo/public/cpp/bindings/binding.h" |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class SingleThreadTaskRunner; | 26 class SingleThreadTaskRunner; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace media { | 29 namespace media { |
| 30 | 30 |
| 31 class MojoCdmTest; | |
| 31 class MojoDecryptor; | 32 class MojoDecryptor; |
| 32 | 33 |
| 33 // A MediaKeys that proxies to a mojom::ContentDecryptionModule. That | 34 // A MediaKeys that proxies to a mojom::ContentDecryptionModule. That |
| 34 // mojom::ContentDecryptionModule proxies back to the MojoCdm via the | 35 // mojom::ContentDecryptionModule proxies back to the MojoCdm via the |
| 35 // mojom::ContentDecryptionModuleClient interface. | 36 // mojom::ContentDecryptionModuleClient interface. |
| 36 class MojoCdm : public MediaKeys, | 37 class MojoCdm : public MediaKeys, |
| 37 public CdmContext, | 38 public CdmContext, |
| 38 public mojom::ContentDecryptionModuleClient { | 39 public mojom::ContentDecryptionModuleClient { |
| 39 public: | 40 public: |
| 40 using MessageType = MediaKeys::MessageType; | 41 using MessageType = MediaKeys::MessageType; |
| (...skipping 28 matching lines...) Expand all Loading... | |
| 69 void RemoveSession(const std::string& session_id, | 70 void RemoveSession(const std::string& session_id, |
| 70 std::unique_ptr<SimpleCdmPromise> promise) final; | 71 std::unique_ptr<SimpleCdmPromise> promise) final; |
| 71 CdmContext* GetCdmContext() final; | 72 CdmContext* GetCdmContext() final; |
| 72 | 73 |
| 73 // CdmContext implementation. Can be called on a different thread. | 74 // CdmContext implementation. Can be called on a different thread. |
| 74 // All GetDecryptor() calls must be made on the same thread. | 75 // All GetDecryptor() calls must be made on the same thread. |
| 75 Decryptor* GetDecryptor() final; | 76 Decryptor* GetDecryptor() final; |
| 76 int GetCdmId() const final; | 77 int GetCdmId() const final; |
| 77 | 78 |
| 78 private: | 79 private: |
| 80 friend class MojoCdmTest; | |
|
xhwang
2016/12/09 06:13:30
This is not needed, see below.
jrummell
2016/12/13 20:57:34
Done.
| |
| 81 | |
| 79 MojoCdm(mojom::ContentDecryptionModulePtr remote_cdm, | 82 MojoCdm(mojom::ContentDecryptionModulePtr remote_cdm, |
| 80 const SessionMessageCB& session_message_cb, | 83 const SessionMessageCB& session_message_cb, |
| 81 const SessionClosedCB& session_closed_cb, | 84 const SessionClosedCB& session_closed_cb, |
| 82 const SessionKeysChangeCB& session_keys_change_cb, | 85 const SessionKeysChangeCB& session_keys_change_cb, |
| 83 const SessionExpirationUpdateCB& session_expiration_update_cb); | 86 const SessionExpirationUpdateCB& session_expiration_update_cb); |
| 84 | 87 |
| 85 ~MojoCdm() final; | 88 ~MojoCdm() final; |
| 86 | 89 |
| 87 void InitializeCdm(const std::string& key_system, | 90 void InitializeCdm(const std::string& key_system, |
| 88 const GURL& security_origin, | 91 const GURL& security_origin, |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 159 | 162 |
| 160 // This must be the last member. | 163 // This must be the last member. |
| 161 base::WeakPtrFactory<MojoCdm> weak_factory_; | 164 base::WeakPtrFactory<MojoCdm> weak_factory_; |
| 162 | 165 |
| 163 DISALLOW_COPY_AND_ASSIGN(MojoCdm); | 166 DISALLOW_COPY_AND_ASSIGN(MojoCdm); |
| 164 }; | 167 }; |
| 165 | 168 |
| 166 } // namespace media | 169 } // namespace media |
| 167 | 170 |
| 168 #endif // MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ | 171 #endif // MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ |
| OLD | NEW |