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

Side by Side Diff: media/mojo/services/mojo_cdm_promise.h

Issue 2080083002: Revert of Deletes mojo::Callback (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months 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/capture/video/video_capture_device.h ('k') | media/mojo/services/mojo_cdm_service.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 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_ 5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_ 6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include "base/callback.h"
11 #include "base/macros.h" 10 #include "base/macros.h"
12 #include "media/base/cdm_promise.h" 11 #include "media/base/cdm_promise.h"
13 #include "media/mojo/common/mojo_type_trait.h" 12 #include "media/mojo/common/mojo_type_trait.h"
14 #include "media/mojo/interfaces/content_decryption_module.mojom.h" 13 #include "media/mojo/interfaces/content_decryption_module.mojom.h"
14 #include "mojo/public/cpp/bindings/callback.h"
15 15
16 namespace media { 16 namespace media {
17 17
18 // media::CdmPromiseTemplate implementations backed by base::Callbacks. 18 // media::CdmPromiseTemplate implementations backed by mojo::Callbacks.
19 template <typename... T> 19 template <typename... T>
20 class MojoCdmPromise : public CdmPromiseTemplate<T...> { 20 class MojoCdmPromise : public CdmPromiseTemplate<T...> {
21 public: 21 public:
22 typedef base::Callback<void(mojom::CdmPromiseResultPtr, 22 typedef mojo::Callback<void(mojom::CdmPromiseResultPtr,
23 typename MojoTypeTrait<T>::MojoType...)> 23 typename MojoTypeTrait<T>::MojoType...)>
24 CallbackType; 24 CallbackType;
25 25
26 MojoCdmPromise(const CallbackType& callback); 26 MojoCdmPromise(const CallbackType& callback);
27 ~MojoCdmPromise() final; 27 ~MojoCdmPromise() final;
28 28
29 // CdmPromiseTemplate<> implementation. 29 // CdmPromiseTemplate<> implementation.
30 void resolve(const T&... result) final; 30 void resolve(const T&... result) final;
31 void reject(MediaKeys::Exception exception, 31 void reject(MediaKeys::Exception exception,
32 uint32_t system_code, 32 uint32_t system_code,
33 const std::string& error_message) final; 33 const std::string& error_message) final;
34 34
35 private: 35 private:
36 using CdmPromiseTemplate<T...>::IsPromiseSettled; 36 using CdmPromiseTemplate<T...>::IsPromiseSettled;
37 using CdmPromiseTemplate<T...>::MarkPromiseSettled; 37 using CdmPromiseTemplate<T...>::MarkPromiseSettled;
38 using CdmPromiseTemplate<T...>::RejectPromiseOnDestruction; 38 using CdmPromiseTemplate<T...>::RejectPromiseOnDestruction;
39 39
40 CallbackType callback_; 40 CallbackType callback_;
41 }; 41 };
42 42
43 } // namespace media 43 } // namespace media
44 44
45 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_ 45 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_
OLDNEW
« no previous file with comments | « media/capture/video/video_capture_device.h ('k') | media/mojo/services/mojo_cdm_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698