| 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 #include "media/base/cdm_callback_promise.h" | 5 #include "media/base/cdm_callback_promise.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 | 8 |
| 9 namespace media { | 9 namespace media { |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 } | 22 } |
| 23 | 23 |
| 24 template <typename... T> | 24 template <typename... T> |
| 25 void CdmCallbackPromise<T...>::resolve(const T&... result) { | 25 void CdmCallbackPromise<T...>::resolve(const T&... result) { |
| 26 MarkPromiseSettled(); | 26 MarkPromiseSettled(); |
| 27 resolve_cb_.Run(result...); | 27 resolve_cb_.Run(result...); |
| 28 } | 28 } |
| 29 | 29 |
| 30 template <typename... T> | 30 template <typename... T> |
| 31 void CdmCallbackPromise<T...>::reject(MediaKeys::Exception exception_code, | 31 void CdmCallbackPromise<T...>::reject(MediaKeys::Exception exception_code, |
| 32 uint32 system_code, | 32 uint32_t system_code, |
| 33 const std::string& error_message) { | 33 const std::string& error_message) { |
| 34 MarkPromiseSettled(); | 34 MarkPromiseSettled(); |
| 35 reject_cb_.Run(exception_code, system_code, error_message); | 35 reject_cb_.Run(exception_code, system_code, error_message); |
| 36 } | 36 } |
| 37 | 37 |
| 38 // Explicit template instantiation for the Promises needed. | 38 // Explicit template instantiation for the Promises needed. |
| 39 template class MEDIA_EXPORT CdmCallbackPromise<>; | 39 template class MEDIA_EXPORT CdmCallbackPromise<>; |
| 40 template class MEDIA_EXPORT CdmCallbackPromise<std::string>; | 40 template class MEDIA_EXPORT CdmCallbackPromise<std::string>; |
| 41 | 41 |
| 42 } // namespace media | 42 } // namespace media |
| OLD | NEW |