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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 const mojo::String& session_id, | 70 const mojo::String& session_id, |
71 bool has_additional_usable_key, | 71 bool has_additional_usable_key, |
72 mojo::Array<mojo::CdmKeyInformationPtr> keys_info) final; | 72 mojo::Array<mojo::CdmKeyInformationPtr> keys_info) final; |
73 void OnSessionExpirationUpdate(const mojo::String& session_id, | 73 void OnSessionExpirationUpdate(const mojo::String& session_id, |
74 int64_t new_expiry_time_usec) final; | 74 int64_t new_expiry_time_usec) final; |
75 | 75 |
76 // Callbacks to handle CDM promises. | 76 // Callbacks to handle CDM promises. |
77 template <typename... T> | 77 template <typename... T> |
78 void OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise, | 78 void OnPromiseResult(scoped_ptr<CdmPromiseTemplate<T...>> promise, |
79 mojo::CdmPromiseResultPtr result, | 79 mojo::CdmPromiseResultPtr result, |
80 typename MojoTypeTrait<T>::MojoType... args); | 80 typename MojoTypeTrait<T>::MojoType... args) { |
Slava Chigrin
2015/01/18 22:12:26
Microsoft compiler in VS 2013 fails compile such m
xhwang
2015/01/19 02:59:51
Add a note/comment here so that we keep record of
| |
81 if (result->success) | |
82 promise->resolve(args.template To<T>()...); // See ISO C++03 14.2/4. | |
83 else | |
84 RejectPromise(promise.Pass(), result.Pass()); | |
85 } | |
81 | 86 |
82 mojo::ContentDecryptionModulePtr remote_cdm_; | 87 mojo::ContentDecryptionModulePtr remote_cdm_; |
83 | 88 |
84 // Callbacks for firing session events. | 89 // Callbacks for firing session events. |
85 SessionMessageCB session_message_cb_; | 90 SessionMessageCB session_message_cb_; |
86 SessionClosedCB session_closed_cb_; | 91 SessionClosedCB session_closed_cb_; |
87 SessionErrorCB session_error_cb_; | 92 SessionErrorCB session_error_cb_; |
88 SessionKeysChangeCB session_keys_change_cb_; | 93 SessionKeysChangeCB session_keys_change_cb_; |
89 SessionExpirationUpdateCB session_expiration_update_cb_; | 94 SessionExpirationUpdateCB session_expiration_update_cb_; |
90 | 95 |
91 base::WeakPtrFactory<MojoCdm> weak_factory_; | 96 base::WeakPtrFactory<MojoCdm> weak_factory_; |
92 | 97 |
93 DISALLOW_COPY_AND_ASSIGN(MojoCdm); | 98 DISALLOW_COPY_AND_ASSIGN(MojoCdm); |
94 }; | 99 }; |
95 | 100 |
96 } // namespace media | 101 } // namespace media |
97 | 102 |
98 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ | 103 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_H_ |
OLD | NEW |