Index: media/base/browser_cdm_factory.h |
diff --git a/media/base/browser_cdm_factory.h b/media/base/browser_cdm_factory.h |
index e6fa47bcaf473a43f8540f8ddcbcd63012278f54..f73ca5d0802849625f19f2538efc424f03c8c838 100644 |
--- a/media/base/browser_cdm_factory.h |
+++ b/media/base/browser_cdm_factory.h |
@@ -7,12 +7,34 @@ |
#include <string> |
+#include "base/macros.h" |
#include "base/memory/scoped_ptr.h" |
#include "media/base/browser_cdm.h" |
#include "media/base/media_export.h" |
namespace media { |
+class MEDIA_EXPORT BrowserCdmFactory { |
+ public: |
+ BrowserCdmFactory() {} |
+ virtual ~BrowserCdmFactory() {} |
+ |
+ virtual scoped_ptr<BrowserCdm> CreateBrowserCdm( |
+ const std::string& key_system, |
+ const BrowserCdm::SessionCreatedCB& session_created_cb, |
+ const BrowserCdm::SessionMessageCB& session_message_cb, |
+ const BrowserCdm::SessionReadyCB& session_ready_cb, |
+ const BrowserCdm::SessionClosedCB& session_closed_cb, |
+ const BrowserCdm::SessionErrorCB& session_error_cb) = 0; |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(BrowserCdmFactory); |
+}; |
+ |
+// Provides a factory for creating BrowserCdm instances. There is only one |
+// BrowserCdmFactory per process. |
+void SetBrowserCdmFactory(BrowserCdmFactory* factory); |
+ |
// Creates a BrowserCdm for |key_system|. Returns NULL if the CDM cannot be |
// created. |
// TODO(xhwang): Add ifdef for IPC based CDM. |