OLD | NEW |
---|---|
(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 CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ | |
6 #define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ | |
7 | |
8 #include <map> | |
9 | |
10 #include "base/basictypes.h" | |
11 #include "media/base/cdm_promise.h" | |
12 #include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" | |
13 | |
14 namespace content { | |
15 | |
16 template <typename T> | |
17 class BlinkCdmPromiseTemplate : public media::CdmPromiseTemplate<T> { | |
18 public: | |
19 BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result); | |
20 BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result, | |
21 const std::string& uma_name); | |
22 | |
23 protected: | |
24 virtual void OnResolve(const T& result); | |
25 void OnReject(media::MediaKeys::Exception exception_code, | |
26 uint32 system_code, | |
27 const std::string& error_message); | |
28 | |
29 blink::WebContentDecryptionModuleResult webCDMResult_; | |
30 | |
31 DISALLOW_COPY_AND_ASSIGN(BlinkCdmPromiseTemplate); | |
32 }; | |
33 | |
34 template <> | |
ddorwin
2014/09/23 23:14:21
// Specialization for no parameter to resolve().
jrummell
2014/09/24 00:49:32
Done.
| |
35 class BlinkCdmPromiseTemplate<void> : public media::CdmPromiseTemplate<void> { | |
36 public: | |
37 BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result); | |
38 BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result, | |
39 const std::string& uma_name); | |
40 | |
41 protected: | |
42 virtual void OnResolve(); | |
43 void OnReject(media::MediaKeys::Exception exception_code, | |
44 uint32 system_code, | |
45 const std::string& error_message); | |
46 | |
47 blink::WebContentDecryptionModuleResult webCDMResult_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(BlinkCdmPromiseTemplate); | |
50 }; | |
51 | |
52 } // namespace content | |
53 | |
54 #endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ | |
OLD | NEW |