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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 mojo::InterfaceRequest<mojom::ContentDecryptionModule> request); | 48 mojo::InterfaceRequest<mojom::ContentDecryptionModule> request); |
49 | 49 |
50 ~MojoCdmService() final; | 50 ~MojoCdmService() final; |
51 | 51 |
52 // mojom::ContentDecryptionModule implementation. | 52 // mojom::ContentDecryptionModule implementation. |
53 void SetClient(mojom::ContentDecryptionModuleClientPtr client) final; | 53 void SetClient(mojom::ContentDecryptionModuleClientPtr client) final; |
54 void Initialize(const mojo::String& key_system, | 54 void Initialize(const mojo::String& key_system, |
55 const mojo::String& security_origin, | 55 const mojo::String& security_origin, |
56 mojom::CdmConfigPtr cdm_config, | 56 mojom::CdmConfigPtr cdm_config, |
57 const InitializeCallback& callback) final; | 57 const InitializeCallback& callback) final; |
58 void SetServerCertificate( | 58 void SetServerCertificate(mojo::Array<uint8_t> certificate_data, |
59 mojo::Array<uint8_t> certificate_data, | 59 const SetServerCertificateCallback& callback) final; |
60 const mojo::Callback<void(mojom::CdmPromiseResultPtr)>& callback) final; | |
61 void CreateSessionAndGenerateRequest( | 60 void CreateSessionAndGenerateRequest( |
62 mojom::ContentDecryptionModule::SessionType session_type, | 61 mojom::ContentDecryptionModule::SessionType session_type, |
63 mojom::ContentDecryptionModule::InitDataType init_data_type, | 62 mojom::ContentDecryptionModule::InitDataType init_data_type, |
64 mojo::Array<uint8_t> init_data, | 63 mojo::Array<uint8_t> init_data, |
65 const mojo::Callback<void(mojom::CdmPromiseResultPtr, mojo::String)>& | 64 const CreateSessionAndGenerateRequestCallback& callback) final; |
66 callback) final; | |
67 void LoadSession(mojom::ContentDecryptionModule::SessionType session_type, | 65 void LoadSession(mojom::ContentDecryptionModule::SessionType session_type, |
68 const mojo::String& session_id, | 66 const mojo::String& session_id, |
69 const mojo::Callback<void(mojom::CdmPromiseResultPtr, | 67 const LoadSessionCallback& callback) final; |
70 mojo::String)>& callback) final; | 68 void UpdateSession(const mojo::String& session_id, |
71 void UpdateSession( | 69 mojo::Array<uint8_t> response, |
72 const mojo::String& session_id, | 70 const UpdateSessionCallback& callback) final; |
73 mojo::Array<uint8_t> response, | 71 void CloseSession(const mojo::String& session_id, |
74 const mojo::Callback<void(mojom::CdmPromiseResultPtr)>& callback) final; | 72 const CloseSessionCallback& callback) final; |
75 void CloseSession( | 73 void RemoveSession(const mojo::String& session_id, |
76 const mojo::String& session_id, | 74 const RemoveSessionCallback& callback) final; |
77 const mojo::Callback<void(mojom::CdmPromiseResultPtr)>& callback) final; | |
78 void RemoveSession( | |
79 const mojo::String& session_id, | |
80 const mojo::Callback<void(mojom::CdmPromiseResultPtr)>& callback) final; | |
81 | 75 |
82 // Get CDM to be used by the media pipeline. | 76 // Get CDM to be used by the media pipeline. |
83 scoped_refptr<MediaKeys> GetCdm(); | 77 scoped_refptr<MediaKeys> GetCdm(); |
84 | 78 |
85 private: | 79 private: |
86 // Callback for CdmFactory::Create(). | 80 // Callback for CdmFactory::Create(). |
87 void OnCdmCreated(const InitializeCallback& callback, | 81 void OnCdmCreated(const InitializeCallback& callback, |
88 const scoped_refptr<MediaKeys>& cdm, | 82 const scoped_refptr<MediaKeys>& cdm, |
89 const std::string& error_message); | 83 const std::string& error_message); |
90 | 84 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 121 |
128 base::WeakPtr<MojoCdmService> weak_this_; | 122 base::WeakPtr<MojoCdmService> weak_this_; |
129 base::WeakPtrFactory<MojoCdmService> weak_factory_; | 123 base::WeakPtrFactory<MojoCdmService> weak_factory_; |
130 | 124 |
131 DISALLOW_COPY_AND_ASSIGN(MojoCdmService); | 125 DISALLOW_COPY_AND_ASSIGN(MojoCdmService); |
132 }; | 126 }; |
133 | 127 |
134 } // namespace media | 128 } // namespace media |
135 | 129 |
136 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ | 130 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_SERVICE_H_ |
OLD | NEW |