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

Unified Diff: content/renderer/media/crypto/render_cdm_factory.h

Issue 660673002: Introduce CdmFactory interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_result_promise
Patch Set: comments addressed Created 6 years, 2 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/crypto/render_cdm_factory.h
diff --git a/content/renderer/media/crypto/content_decryption_module_factory.h b/content/renderer/media/crypto/render_cdm_factory.h
similarity index 55%
rename from content/renderer/media/crypto/content_decryption_module_factory.h
rename to content/renderer/media/crypto/render_cdm_factory.h
index be91112a902456418bab9c677a7e7e1bd0963c36..4be2acfd8a5acda9f8c2277afec8b78705b87129 100644
--- a/content/renderer/media/crypto/content_decryption_module_factory.h
+++ b/content/renderer/media/crypto/render_cdm_factory.h
@@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CONTENT_RENDERER_MEDIA_CRYPTO_CONTENT_DECRYPTION_MODULE_FACTORY_H_
-#define CONTENT_RENDERER_MEDIA_CRYPTO_CONTENT_DECRYPTION_MODULE_FACTORY_H_
+#ifndef CONTENT_RENDERER_MEDIA_CRYPTO_RENDER_CDM_FACTORY_H_
+#define CONTENT_RENDERER_MEDIA_CRYPTO_RENDER_CDM_FACTORY_H_
#include <string>
#include "base/memory/scoped_ptr.h"
+#include "media/base/cdm_factory.h"
#include "media/base/media_keys.h"
#if defined(ENABLE_PEPPER_CDMS)
@@ -22,27 +23,42 @@ namespace content {
class RendererCdmManager;
#endif
-class ContentDecryptionModuleFactory {
+class RenderCdmFactory : public media::CdmFactory {
public:
- // |create_pepper_cdm_cb| will be called synchronously if necessary. The other
- // callbacks can be called asynchronously.
- static scoped_ptr<media::MediaKeys> Create(
- const std::string& key_system,
- const GURL& security_origin,
#if defined(ENABLE_PEPPER_CDMS)
- const CreatePepperCdmCB& create_pepper_cdm_cb,
+ explicit RenderCdmFactory(const CreatePepperCdmCB& create_pepper_cdm_cb);
#elif defined(ENABLE_BROWSER_CDMS)
- RendererCdmManager* manager,
- int* cdm_id, // Output parameter indicating the CDM ID of the MediaKeys.
+ explicit RenderCdmFactory(RendererCdmManager* manager);
+#else
+ RenderCdmFactory();
#endif // defined(ENABLE_PEPPER_CDMS)
+
+ virtual ~RenderCdmFactory();
+
+ virtual scoped_ptr<media::MediaKeys> Create(
+ const std::string& key_system,
+ const GURL& security_origin,
+#if defined(ENABLE_BROWSER_CDMS)
+ int* cdm_id,
+#endif
const media::SessionMessageCB& session_message_cb,
const media::SessionReadyCB& session_ready_cb,
const media::SessionClosedCB& session_closed_cb,
const media::SessionErrorCB& session_error_cb,
const media::SessionKeysChangeCB& session_keys_change_cb,
- const media::SessionExpirationUpdateCB& session_expiration_update_cb);
+ const media::SessionExpirationUpdateCB& session_expiration_update_cb)
+ const override;
+
+ private:
+#if defined(ENABLE_PEPPER_CDMS)
+ const CreatePepperCdmCB create_pepper_cdm_cb_;
+#elif defined(ENABLE_BROWSER_CDMS)
+ const RendererCdmManager* manager_;
ddorwin 2014/10/16 20:33:20 Does this compile on Android? It seems unlikely we
xhwang 2014/10/17 00:11:49 I think you are right. But I do like passing const
+#endif
+
+ DISALLOW_COPY_AND_ASSIGN(RenderCdmFactory);
};
} // namespace content
-#endif // CONTENT_RENDERER_MEDIA_CRYPTO_CONTENT_DECRYPTION_MODULE_FACTORY_H_
+#endif // CONTENT_RENDERER_MEDIA_CRYPTO_RENDER_CDM_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698