| 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_SERVICES_MOJO_CDM_SERVICE_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ |
| 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 | 27 |
| 28 // A mojom::ContentDecryptionModule implementation backed by a | 28 // A mojom::ContentDecryptionModule implementation backed by a |
| 29 // media::MediaKeys. | 29 // media::MediaKeys. |
| 30 class MEDIA_MOJO_EXPORT MojoCdmService | 30 class MEDIA_MOJO_EXPORT MojoCdmService |
| 31 : NON_EXPORTED_BASE(public mojom::ContentDecryptionModule) { | 31 : NON_EXPORTED_BASE(public mojom::ContentDecryptionModule) { |
| 32 public: | 32 public: |
| 33 // Get the CDM associated with |cdm_id|, which is unique per process. | 33 // Get the CDM associated with |cdm_id|, which is unique per process. |
| 34 // Can be called on any thread. The returned CDM is not guaranteed to be | 34 // Can be called on any thread. The returned CDM is not guaranteed to be |
| 35 // thread safe. | 35 // thread safe. |
| 36 // Note: This provides a generic hack to get the CDM in the process where | 36 // Note: This provides a generic hack to get the CDM in the process where |
| 37 // MojoMediaApplication is running, regardless of which render process or | 37 // MediaService is running, regardless of which render process or |
| 38 // render frame the caller is associated with. In the future, we should move | 38 // render frame the caller is associated with. In the future, we should move |
| 39 // all out-of-process media players into the MojoMediaApplicaiton so that we | 39 // all out-of-process media players into the MediaService so that we can use |
| 40 // can use MojoCdmServiceContext (per render frame) to get the CDM. | 40 // MojoCdmServiceContext (per render frame) to get the CDM. |
| 41 static scoped_refptr<MediaKeys> LegacyGetCdm(int cdm_id); | 41 static scoped_refptr<MediaKeys> LegacyGetCdm(int cdm_id); |
| 42 | 42 |
| 43 // Constructs a MojoCdmService and strongly binds it to the |request|. | 43 // Constructs a MojoCdmService and strongly binds it to the |request|. |
| 44 MojoCdmService(base::WeakPtr<MojoCdmServiceContext> context, | 44 MojoCdmService(base::WeakPtr<MojoCdmServiceContext> context, |
| 45 CdmFactory* cdm_factory); | 45 CdmFactory* cdm_factory); |
| 46 | 46 |
| 47 ~MojoCdmService() final; | 47 ~MojoCdmService() final; |
| 48 | 48 |
| 49 // mojom::ContentDecryptionModule implementation. | 49 // mojom::ContentDecryptionModule implementation. |
| 50 void SetClient(mojom::ContentDecryptionModuleClientPtr client) final; | 50 void SetClient(mojom::ContentDecryptionModuleClientPtr client) final; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 base::WeakPtr<MojoCdmService> weak_this_; | 113 base::WeakPtr<MojoCdmService> weak_this_; |
| 114 base::WeakPtrFactory<MojoCdmService> weak_factory_; | 114 base::WeakPtrFactory<MojoCdmService> weak_factory_; |
| 115 | 115 |
| 116 DISALLOW_COPY_AND_ASSIGN(MojoCdmService); | 116 DISALLOW_COPY_AND_ASSIGN(MojoCdmService); |
| 117 }; | 117 }; |
| 118 | 118 |
| 119 } // namespace media | 119 } // namespace media |
| 120 | 120 |
| 121 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ | 121 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ |
| OLD | NEW |