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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 | 140 |
141 // Protects |cdm_id_|, |decryptor_ptr_|, |decryptor_| and | 141 // Protects |cdm_id_|, |decryptor_ptr_|, |decryptor_| and |
142 // |decryptor_task_runner_| which could be accessed from other threads. | 142 // |decryptor_task_runner_| which could be accessed from other threads. |
143 // See CdmContext implementation above. | 143 // See CdmContext implementation above. |
144 mutable base::Lock lock_; | 144 mutable base::Lock lock_; |
145 | 145 |
146 // CDM ID of the remote CDM. Set after initialization is completed. Must not | 146 // CDM ID of the remote CDM. Set after initialization is completed. Must not |
147 // be invalid if initialization succeeded. | 147 // be invalid if initialization succeeded. |
148 int cdm_id_; | 148 int cdm_id_; |
149 | 149 |
150 // The DecryptorPtr exposed by the remote CDM. Set after initialization is | 150 // The DecryptorPtrInfo exposed by the remote CDM. Set after initialization |
151 // completed and cleared after |decryptor_| is created. May be null after | 151 // is completed and cleared after |decryptor_| is created. May be invalid |
152 // initialization if the CDM doesn't support a Decryptor. | 152 // after initialization if the CDM doesn't support a Decryptor. |
153 mojom::DecryptorPtr decryptor_ptr_; | 153 mojom::DecryptorPtrInfo decryptor_ptr_info_; |
154 | 154 |
155 // Decryptor based on |decryptor_ptr_|, lazily created in GetDecryptor(). | 155 // Decryptor based on |decryptor_ptr_|, lazily created in GetDecryptor(). |
156 // Since GetDecryptor() can be called on a different thread, use | 156 // Since GetDecryptor() can be called on a different thread, use |
157 // |decryptor_task_runner_| to bind |decryptor_| to that thread. | 157 // |decryptor_task_runner_| to bind |decryptor_| to that thread. |
158 std::unique_ptr<MojoDecryptor> decryptor_; | 158 std::unique_ptr<MojoDecryptor> decryptor_; |
159 scoped_refptr<base::SingleThreadTaskRunner> decryptor_task_runner_; | 159 scoped_refptr<base::SingleThreadTaskRunner> decryptor_task_runner_; |
160 | 160 |
161 // Callbacks for firing session events. | 161 // Callbacks for firing session events. |
162 SessionMessageCB session_message_cb_; | 162 SessionMessageCB session_message_cb_; |
163 SessionClosedCB session_closed_cb_; | 163 SessionClosedCB session_closed_cb_; |
164 LegacySessionErrorCB legacy_session_error_cb_; | 164 LegacySessionErrorCB legacy_session_error_cb_; |
165 SessionKeysChangeCB session_keys_change_cb_; | 165 SessionKeysChangeCB session_keys_change_cb_; |
166 SessionExpirationUpdateCB session_expiration_update_cb_; | 166 SessionExpirationUpdateCB session_expiration_update_cb_; |
167 | 167 |
168 // Pending promise for InitializeCdm(). | 168 // Pending promise for InitializeCdm(). |
169 std::unique_ptr<CdmInitializedPromise> pending_init_promise_; | 169 std::unique_ptr<CdmInitializedPromise> pending_init_promise_; |
170 | 170 |
171 // This must be the last member. | 171 // This must be the last member. |
172 base::WeakPtrFactory<MojoCdm> weak_factory_; | 172 base::WeakPtrFactory<MojoCdm> weak_factory_; |
173 | 173 |
174 DISALLOW_COPY_AND_ASSIGN(MojoCdm); | 174 DISALLOW_COPY_AND_ASSIGN(MojoCdm); |
175 }; | 175 }; |
176 | 176 |
177 } // namespace media | 177 } // namespace media |
178 | 178 |
179 #endif // MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ | 179 #endif // MEDIA_MOJO_CLIENTS_MOJO_CDM_H_ |
OLD | NEW |