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

Unified Diff: content/renderer/media/webcontentdecryptionmoduleresult_helper.h

Issue 555223004: Update MediaKeys interface for EME (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: BlinkCdmPromiseTemplate Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
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_

Powered by Google App Engine
This is Rietveld 408576698