Index: content/renderer/media/webcontentdecryptionmoduleresult_helper.h |
diff --git a/content/renderer/media/webcontentdecryptionmoduleresult_helper.h b/content/renderer/media/webcontentdecryptionmoduleresult_helper.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..38b5c036b62a4f054e003aad4d1a71e767910ed5 |
--- /dev/null |
+++ b/content/renderer/media/webcontentdecryptionmoduleresult_helper.h |
@@ -0,0 +1,54 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ |
+#define CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ |
+ |
+#include <map> |
+ |
+#include "base/basictypes.h" |
+#include "media/base/cdm_promise.h" |
+#include "third_party/WebKit/public/platform/WebContentDecryptionModuleResult.h" |
+ |
+namespace content { |
+ |
+template <typename T> |
+class BlinkCdmPromiseTemplate : public media::CdmPromiseTemplate<T> { |
+ public: |
+ BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result); |
+ BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result, |
+ const std::string& uma_name); |
+ |
+ protected: |
+ virtual void OnResolve(const T& result); |
+ void OnReject(media::MediaKeys::Exception exception_code, |
+ uint32 system_code, |
+ const std::string& error_message); |
+ |
+ blink::WebContentDecryptionModuleResult webCDMResult_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BlinkCdmPromiseTemplate); |
+}; |
+ |
+template <> |
ddorwin
2014/09/23 23:14:21
// Specialization for no parameter to resolve().
jrummell
2014/09/24 00:49:32
Done.
|
+class BlinkCdmPromiseTemplate<void> : public media::CdmPromiseTemplate<void> { |
+ public: |
+ BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result); |
+ BlinkCdmPromiseTemplate(blink::WebContentDecryptionModuleResult result, |
+ const std::string& uma_name); |
+ |
+ protected: |
+ virtual void OnResolve(); |
+ void OnReject(media::MediaKeys::Exception exception_code, |
+ uint32 system_code, |
+ const std::string& error_message); |
+ |
+ blink::WebContentDecryptionModuleResult webCDMResult_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(BlinkCdmPromiseTemplate); |
+}; |
+ |
+} // namespace content |
+ |
+#endif // CONTENT_RENDERER_MEDIA_WEBCONTENTDECRYPTIONMODULERESULT_HELPER_H_ |