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_H_ | 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_H_ |
6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_H_ | 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 const GURL& security_origin, | 34 const GURL& security_origin, |
35 const media::CdmConfig& cdm_config, | 35 const media::CdmConfig& cdm_config, |
36 interfaces::ContentDecryptionModulePtr remote_cdm, | 36 interfaces::ContentDecryptionModulePtr remote_cdm, |
37 const media::SessionMessageCB& session_message_cb, | 37 const media::SessionMessageCB& session_message_cb, |
38 const media::SessionClosedCB& session_closed_cb, | 38 const media::SessionClosedCB& session_closed_cb, |
39 const media::LegacySessionErrorCB& legacy_session_error_cb, | 39 const media::LegacySessionErrorCB& legacy_session_error_cb, |
40 const media::SessionKeysChangeCB& session_keys_change_cb, | 40 const media::SessionKeysChangeCB& session_keys_change_cb, |
41 const media::SessionExpirationUpdateCB& session_expiration_update_cb, | 41 const media::SessionExpirationUpdateCB& session_expiration_update_cb, |
42 const media::CdmCreatedCB& cdm_created_cb); | 42 const media::CdmCreatedCB& cdm_created_cb); |
43 | 43 |
44 ~MojoCdm() final; | |
45 | |
46 // MediaKeys implementation. | 44 // MediaKeys implementation. |
47 void SetServerCertificate(const std::vector<uint8_t>& certificate, | 45 void SetServerCertificate(const std::vector<uint8_t>& certificate, |
48 scoped_ptr<SimpleCdmPromise> promise) final; | 46 scoped_ptr<SimpleCdmPromise> promise) final; |
49 void CreateSessionAndGenerateRequest( | 47 void CreateSessionAndGenerateRequest( |
50 SessionType session_type, | 48 SessionType session_type, |
51 EmeInitDataType init_data_type, | 49 EmeInitDataType init_data_type, |
52 const std::vector<uint8_t>& init_data, | 50 const std::vector<uint8_t>& init_data, |
53 scoped_ptr<NewSessionCdmPromise> promise) final; | 51 scoped_ptr<NewSessionCdmPromise> promise) final; |
54 void LoadSession(SessionType session_type, | 52 void LoadSession(SessionType session_type, |
55 const std::string& session_id, | 53 const std::string& session_id, |
(...skipping 12 matching lines...) Expand all Loading... |
68 int GetCdmId() const final; | 66 int GetCdmId() const final; |
69 | 67 |
70 private: | 68 private: |
71 MojoCdm(interfaces::ContentDecryptionModulePtr remote_cdm, | 69 MojoCdm(interfaces::ContentDecryptionModulePtr remote_cdm, |
72 const SessionMessageCB& session_message_cb, | 70 const SessionMessageCB& session_message_cb, |
73 const SessionClosedCB& session_closed_cb, | 71 const SessionClosedCB& session_closed_cb, |
74 const LegacySessionErrorCB& legacy_session_error_cb, | 72 const LegacySessionErrorCB& legacy_session_error_cb, |
75 const SessionKeysChangeCB& session_keys_change_cb, | 73 const SessionKeysChangeCB& session_keys_change_cb, |
76 const SessionExpirationUpdateCB& session_expiration_update_cb); | 74 const SessionExpirationUpdateCB& session_expiration_update_cb); |
77 | 75 |
| 76 ~MojoCdm() final; |
| 77 |
78 void InitializeCdm(const std::string& key_system, | 78 void InitializeCdm(const std::string& key_system, |
79 const GURL& security_origin, | 79 const GURL& security_origin, |
80 const media::CdmConfig& cdm_config, | 80 const media::CdmConfig& cdm_config, |
81 scoped_ptr<CdmInitializedPromise> promise); | 81 scoped_ptr<CdmInitializedPromise> promise); |
82 | 82 |
83 // interfaces::ContentDecryptionModuleClient implementation. | 83 // interfaces::ContentDecryptionModuleClient implementation. |
84 void OnSessionMessage(const mojo::String& session_id, | 84 void OnSessionMessage(const mojo::String& session_id, |
85 interfaces::CdmMessageType message_type, | 85 interfaces::CdmMessageType message_type, |
86 mojo::Array<uint8_t> message, | 86 mojo::Array<uint8_t> message, |
87 const mojo::String& legacy_destination_url) final; | 87 const mojo::String& legacy_destination_url) final; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 SessionExpirationUpdateCB session_expiration_update_cb_; | 130 SessionExpirationUpdateCB session_expiration_update_cb_; |
131 | 131 |
132 base::WeakPtrFactory<MojoCdm> weak_factory_; | 132 base::WeakPtrFactory<MojoCdm> weak_factory_; |
133 | 133 |
134 DISALLOW_COPY_AND_ASSIGN(MojoCdm); | 134 DISALLOW_COPY_AND_ASSIGN(MojoCdm); |
135 }; | 135 }; |
136 | 136 |
137 } // namespace media | 137 } // namespace media |
138 | 138 |
139 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ | 139 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ |
OLD | NEW |