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

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

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/android/media_drm_bridge.cc ('k') | media/base/cdm_callback_promise.cc » ('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 #ifndef MEDIA_BASE_CDM_CALLBACK_PROMISE_H_ 5 #ifndef MEDIA_BASE_CDM_CALLBACK_PROMISE_H_
6 #define MEDIA_BASE_CDM_CALLBACK_PROMISE_H_ 6 #define MEDIA_BASE_CDM_CALLBACK_PROMISE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/callback.h" 12 #include "base/callback.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "media/base/cdm_promise.h" 14 #include "media/base/cdm_promise.h"
15 #include "media/base/media_export.h" 15 #include "media/base/media_export.h"
16 #include "media/base/media_keys.h" 16 #include "media/base/media_keys.h"
17 17
18 namespace media { 18 namespace media {
19 19
20 typedef base::Callback<void(MediaKeys::Exception exception_code, 20 typedef base::Callback<void(CdmPromise::Exception exception_code,
21 uint32_t system_code, 21 uint32_t system_code,
22 const std::string& error_message)> 22 const std::string& error_message)>
23 PromiseRejectedCB; 23 PromiseRejectedCB;
24 24
25 template <typename... T> 25 template <typename... T>
26 class MEDIA_EXPORT CdmCallbackPromise : public CdmPromiseTemplate<T...> { 26 class MEDIA_EXPORT CdmCallbackPromise : public CdmPromiseTemplate<T...> {
27 public: 27 public:
28 CdmCallbackPromise(const base::Callback<void(const T&...)>& resolve_cb, 28 CdmCallbackPromise(const base::Callback<void(const T&...)>& resolve_cb,
29 const PromiseRejectedCB& reject_cb); 29 const PromiseRejectedCB& reject_cb);
30 virtual ~CdmCallbackPromise(); 30 virtual ~CdmCallbackPromise();
31 31
32 // CdmPromiseTemplate<T> implementation. 32 // CdmPromiseTemplate<T> implementation.
33 virtual void resolve(const T&... result) override; 33 virtual void resolve(const T&... result) override;
34 virtual void reject(MediaKeys::Exception exception_code, 34 virtual void reject(CdmPromise::Exception exception_code,
35 uint32_t system_code, 35 uint32_t system_code,
36 const std::string& error_message) override; 36 const std::string& error_message) override;
37 37
38 private: 38 private:
39 using CdmPromiseTemplate<T...>::IsPromiseSettled; 39 using CdmPromiseTemplate<T...>::IsPromiseSettled;
40 using CdmPromiseTemplate<T...>::MarkPromiseSettled; 40 using CdmPromiseTemplate<T...>::MarkPromiseSettled;
41 using CdmPromiseTemplate<T...>::RejectPromiseOnDestruction; 41 using CdmPromiseTemplate<T...>::RejectPromiseOnDestruction;
42 42
43 base::Callback<void(const T&...)> resolve_cb_; 43 base::Callback<void(const T&...)> resolve_cb_;
44 PromiseRejectedCB reject_cb_; 44 PromiseRejectedCB reject_cb_;
45 45
46 DISALLOW_COPY_AND_ASSIGN(CdmCallbackPromise); 46 DISALLOW_COPY_AND_ASSIGN(CdmCallbackPromise);
47 }; 47 };
48 48
49 } // namespace media 49 } // namespace media
50 50
51 #endif // MEDIA_BASE_CDM_CALLBACK_PROMISE_H_ 51 #endif // MEDIA_BASE_CDM_CALLBACK_PROMISE_H_
OLDNEW
« no previous file with comments | « media/base/android/media_drm_bridge.cc ('k') | media/base/cdm_callback_promise.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698