| 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 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 void OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise, | 81 void OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise, |
| 82 mojo::CdmPromiseResultPtr result, | 82 mojo::CdmPromiseResultPtr result, |
| 83 typename MojoTypeTrait<T>::MojoType... args) { | 83 typename MojoTypeTrait<T>::MojoType... args) { |
| 84 if (result->success) | 84 if (result->success) |
| 85 promise->resolve(args.template To<T>()...); // See ISO C++03 14.2/4. | 85 promise->resolve(args.template To<T>()...); // See ISO C++03 14.2/4. |
| 86 else | 86 else |
| 87 RejectPromise(promise.Pass(), result.Pass()); | 87 RejectPromise(promise.Pass(), result.Pass()); |
| 88 } | 88 } |
| 89 | 89 |
| 90 mojo::ContentDecryptionModulePtr remote_cdm_; | 90 mojo::ContentDecryptionModulePtr remote_cdm_; |
| 91 mojo::Binding<ContentDecryptionModuleClient> binding_; |
| 91 | 92 |
| 92 // Callbacks for firing session events. | 93 // Callbacks for firing session events. |
| 93 SessionMessageCB session_message_cb_; | 94 SessionMessageCB session_message_cb_; |
| 94 SessionClosedCB session_closed_cb_; | 95 SessionClosedCB session_closed_cb_; |
| 95 SessionErrorCB session_error_cb_; | 96 SessionErrorCB session_error_cb_; |
| 96 SessionKeysChangeCB session_keys_change_cb_; | 97 SessionKeysChangeCB session_keys_change_cb_; |
| 97 SessionExpirationUpdateCB session_expiration_update_cb_; | 98 SessionExpirationUpdateCB session_expiration_update_cb_; |
| 98 | 99 |
| 99 base::WeakPtrFactory<MojoCdm> weak_factory_; | 100 base::WeakPtrFactory<MojoCdm> weak_factory_; |
| 100 | 101 |
| 101 DISALLOW_COPY_AND_ASSIGN(MojoCdm); | 102 DISALLOW_COPY_AND_ASSIGN(MojoCdm); |
| 102 }; | 103 }; |
| 103 | 104 |
| 104 } // namespace media | 105 } // namespace media |
| 105 | 106 |
| 106 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ | 107 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ |
| OLD | NEW |