Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Side by Side Diff: media/base/cdm_callback_promise.cc

Issue 2444683002: Move MediaKeys::Exception to CdmPromise::Exception (Closed)
Patch Set: include "media/base/media_keys.h" Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « media/base/cdm_callback_promise.h ('k') | media/base/cdm_initialized_promise.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 9
10 namespace media { 10 namespace media {
(...skipping 16 matching lines...) Expand all
27 RejectPromiseOnDestruction(); 27 RejectPromiseOnDestruction();
28 } 28 }
29 29
30 template <typename... T> 30 template <typename... T>
31 void CdmCallbackPromise<T...>::resolve(const T&... result) { 31 void CdmCallbackPromise<T...>::resolve(const T&... result) {
32 MarkPromiseSettled(); 32 MarkPromiseSettled();
33 base::ResetAndReturn(&resolve_cb_).Run(result...); 33 base::ResetAndReturn(&resolve_cb_).Run(result...);
34 } 34 }
35 35
36 template <typename... T> 36 template <typename... T>
37 void CdmCallbackPromise<T...>::reject(MediaKeys::Exception exception_code, 37 void CdmCallbackPromise<T...>::reject(CdmPromise::Exception exception_code,
38 uint32_t system_code, 38 uint32_t system_code,
39 const std::string& error_message) { 39 const std::string& error_message) {
40 MarkPromiseSettled(); 40 MarkPromiseSettled();
41 base::ResetAndReturn(&reject_cb_) 41 base::ResetAndReturn(&reject_cb_)
42 .Run(exception_code, system_code, error_message); 42 .Run(exception_code, system_code, error_message);
43 } 43 }
44 44
45 // Explicit template instantiation for the Promises needed. 45 // Explicit template instantiation for the Promises needed.
46 template class MEDIA_EXPORT CdmCallbackPromise<>; 46 template class MEDIA_EXPORT CdmCallbackPromise<>;
47 template class MEDIA_EXPORT CdmCallbackPromise<std::string>; 47 template class MEDIA_EXPORT CdmCallbackPromise<std::string>;
48 48
49 } // namespace media 49 } // namespace media
OLDNEW
« no previous file with comments | « media/base/cdm_callback_promise.h ('k') | media/base/cdm_initialized_promise.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698