| 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 "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "media/base/media_keys.h" | 10 #include "media/base/media_keys.h" |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 private: | 56 private: |
| 57 // mojo::ContentDecryptionModuleClient implementation. | 57 // mojo::ContentDecryptionModuleClient implementation. |
| 58 void OnSessionMessage(const mojo::String& session_id, | 58 void OnSessionMessage(const mojo::String& session_id, |
| 59 mojo::Array<uint8_t> message, | 59 mojo::Array<uint8_t> message, |
| 60 const mojo::String& destination_url) final; | 60 const mojo::String& destination_url) final; |
| 61 void OnSessionClosed(const mojo::String& session_id) final; | 61 void OnSessionClosed(const mojo::String& session_id) final; |
| 62 void OnSessionError(const mojo::String& session_id, | 62 void OnSessionError(const mojo::String& session_id, |
| 63 mojo::CdmException exception, | 63 mojo::CdmException exception, |
| 64 uint32_t system_code, | 64 uint32_t system_code, |
| 65 const mojo::String& error_message) final; | 65 const mojo::String& error_message) final; |
| 66 void OnSessionKeysChange(const mojo::String& session_id, | 66 void OnSessionKeysChange( |
| 67 bool has_additional_usable_key) final; | 67 const mojo::String& session_id, |
| 68 bool has_additional_usable_key, |
| 69 mojo::Array<mojo::CdmKeyInformationPtr> key_information) final; |
| 68 void OnSessionExpirationUpdate(const mojo::String& session_id, | 70 void OnSessionExpirationUpdate(const mojo::String& session_id, |
| 69 int64_t new_expiry_time_usec) final; | 71 int64_t new_expiry_time_usec) final; |
| 70 | 72 |
| 71 // Callbacks to handle CDM promises. | 73 // Callbacks to handle CDM promises. |
| 72 template <typename... T> | 74 template <typename... T> |
| 73 void OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise, | 75 void OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise, |
| 74 mojo::CdmPromiseResultPtr result, | 76 mojo::CdmPromiseResultPtr result, |
| 75 typename MojoTypeTrait<T>::MojoType... args); | 77 typename MojoTypeTrait<T>::MojoType... args); |
| 76 | 78 |
| 77 mojo::ContentDecryptionModulePtr remote_cdm_; | 79 mojo::ContentDecryptionModulePtr remote_cdm_; |
| 78 | 80 |
| 79 // Callbacks for firing session events. | 81 // Callbacks for firing session events. |
| 80 SessionMessageCB session_message_cb_; | 82 SessionMessageCB session_message_cb_; |
| 81 SessionClosedCB session_closed_cb_; | 83 SessionClosedCB session_closed_cb_; |
| 82 SessionErrorCB session_error_cb_; | 84 SessionErrorCB session_error_cb_; |
| 83 SessionKeysChangeCB session_keys_change_cb_; | 85 SessionKeysChangeCB session_keys_change_cb_; |
| 84 SessionExpirationUpdateCB session_expiration_update_cb_; | 86 SessionExpirationUpdateCB session_expiration_update_cb_; |
| 85 | 87 |
| 86 base::WeakPtrFactory<MojoCdm> weak_factory_; | 88 base::WeakPtrFactory<MojoCdm> weak_factory_; |
| 87 | 89 |
| 88 DISALLOW_COPY_AND_ASSIGN(MojoCdm); | 90 DISALLOW_COPY_AND_ASSIGN(MojoCdm); |
| 89 }; | 91 }; |
| 90 | 92 |
| 91 } // namespace media | 93 } // namespace media |
| 92 | 94 |
| 93 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ | 95 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ |
| OLD | NEW |