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

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: Pass CdmFactory by pointer. 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..ac6dd0b1de2de59de8edd32c7bc792762e2b2e7b 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);
ddorwin 2014/10/17 16:32:04 What is the ownership story for the manager? How d
xhwang 2014/10/17 20:09:22 It's a per-render-frame object owned by RenderFram
ddorwin 2014/10/19 06:07:25 Maybe we should document this assumption here.
xhwang 2014/10/20 16:36:29 Done.
+#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)
+ override;
+
+ private:
+#if defined(ENABLE_PEPPER_CDMS)
+ CreatePepperCdmCB create_pepper_cdm_cb_;
+#elif defined(ENABLE_BROWSER_CDMS)
+ RendererCdmManager* manager_;
ddorwin 2014/10/17 16:32:04 nit: It's okay for this to be const still if you w
xhwang 2014/10/17 20:09:22 That's true. But usually we don't use const for th
+#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