OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef MEDIA_REMOTING_REMOTING_CDM_FACTORY_H_ |
| 6 #define MEDIA_REMOTING_REMOTING_CDM_FACTORY_H_ |
| 7 |
| 8 #include "base/memory/weak_ptr.h" |
| 9 #include "media/base/cdm_factory.h" |
| 10 #include "media/mojo/interfaces/remoting.mojom.h" |
| 11 #include "media/remoting/remoting_cdm_controller.h" |
| 12 |
| 13 namespace media { |
| 14 |
| 15 // TODO(xjz): Merge this with Eric's implementation. |
| 16 class RemotingCdmFactory : public CdmFactory { |
| 17 public: |
| 18 // |remoter_factory| is expected to outlive this class. |
| 19 RemotingCdmFactory(std::unique_ptr<CdmFactory> default_cdm_factory, |
| 20 mojom::RemoterFactory* remoter_factory); |
| 21 ~RemotingCdmFactory() override; |
| 22 |
| 23 void Create(const std::string& key_system, |
| 24 const GURL& security_origin, |
| 25 const CdmConfig& cdm_config, |
| 26 const SessionMessageCB& session_message_cb, |
| 27 const SessionClosedCB& session_closed_cb, |
| 28 const SessionKeysChangeCB& session_keys_change_cb, |
| 29 const SessionExpirationUpdateCB& session_expiration_update_cb, |
| 30 const CdmCreatedCB& cdm_created_cb) override; |
| 31 |
| 32 private: |
| 33 std::unique_ptr<RemotingCdmController> CreateRemotingCdmController(); |
| 34 void CreateCdm(const std::string& key_system, |
| 35 const GURL& security_origin, |
| 36 const CdmConfig& cdm_config, |
| 37 const SessionMessageCB& session_message_cb, |
| 38 const SessionClosedCB& session_closed_cb, |
| 39 const SessionKeysChangeCB& session_keys_change_cb, |
| 40 const SessionExpirationUpdateCB& session_expiration_update_cb, |
| 41 const CdmCreatedCB& cdm_created_cb, |
| 42 std::unique_ptr<RemotingCdmController> remoting_cdm_controller, |
| 43 bool is_remoting); |
| 44 |
| 45 const std::unique_ptr<CdmFactory> default_cdm_factory_; |
| 46 mojom::RemoterFactory* const remoter_factory_; // Outlives this class. |
| 47 base::WeakPtrFactory<RemotingCdmFactory> weak_factory_; |
| 48 |
| 49 DISALLOW_COPY_AND_ASSIGN(RemotingCdmFactory); |
| 50 }; |
| 51 |
| 52 } // namespace media |
| 53 |
| 54 #endif // MEDIA_REMOTING_REMOTING_CDM_FACTORY_H_ |
OLD | NEW |