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

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

Issue 763883006: Add Mojo CDM Service. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: More updates. Created 6 years 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_
6 #define MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_
7
8 #include "base/macros.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "base/memory/weak_ptr.h"
11 #include "media/base/cdm_promise.h"
12 #include "media/mojo/interfaces/content_decryption_module.mojom.h"
13 #include "media/mojo/services/mojo_type_trait.h"
14 #include "mojo/public/cpp/bindings/array.h"
ddorwin 2014/12/12 19:25:13 Not used?
xhwang 2014/12/12 23:15:44 Done.
15 #include "mojo/public/cpp/bindings/callback.h"
16 #include "mojo/public/cpp/bindings/interface_impl.h"
17 #include "mojo/public/cpp/bindings/string.h"
ddorwin 2014/12/12 19:25:13 Is it correct to use this for std::string?
xhwang 2014/12/12 23:15:44 Done.
18
19 namespace media {
20
21 // media::CdmPromiseTemplate implementations backed by mojo::Callbacks.
22 template <typename... T>
23 class MojoCdmPromise : public CdmPromiseTemplate<T...> {
24 public:
25 typedef mojo::Callback<void(mojo::CdmPromiseResultPtr,
26 typename MojoTypeTrait<T>::MojoType...)>
27 CallbackType;
28
29 MojoCdmPromise(const CallbackType& callback);
30 ~MojoCdmPromise() final;
31
32 // CdmPromiseTemplate<> implementation.
33 void resolve(const T&... result) final;
34 void reject(MediaKeys::Exception exception,
35 uint32 system_code,
36 const std::string& error_message) final;
37
38 private:
39 CallbackType callback_;
40 };
41
42 } // namespace media
43
44 #endif // MEDIA_MOJO_SERVICES_MOJO_CDM_PROMISE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698