Index: media/base/cdm_context.h |
diff --git a/media/base/cdm_context.h b/media/base/cdm_context.h |
index a0861c4e5db41359f0e877c5ebce59008fde5c9d..61d37ea43b4362bfd37e8c6e96096820b7acdfaa 100644 |
--- a/media/base/cdm_context.h |
+++ b/media/base/cdm_context.h |
@@ -41,6 +41,26 @@ class MEDIA_EXPORT CdmContext { |
DISALLOW_COPY_AND_ASSIGN(CdmContext); |
}; |
+// An interface that provides the access to a CdmContext through |cdm_id|. |
+// This is typically used when CDMs are hosted remotely. |
+class MEDIA_EXPORT CdmContextProvider { |
+ public: |
+ virtual ~CdmContextProvider(); |
+ |
+ // Returns the CdmContext corresponding to |cdm_id|. Returns nullptr if no |
+ // such CdmContext can be found. |
+ // Note: |cdm_id| is irrelevant to GetCdmId() of the returned CdmContext. |
+ // The former is used to locate the real CDM (the latter), which could just |
+ // be a local CDM that doesn't support a CDM ID. |
+ virtual CdmContext* GetCdmContext(int cdm_id) = 0; |
+ |
+ protected: |
+ CdmContextProvider(); |
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(CdmContextProvider); |
+}; |
+ |
// Callback to notify that the CdmContext has been completely attached to |
// the media pipeline. Parameter indicates whether the operation succeeded. |
typedef base::Callback<void(bool)> CdmAttachedCB; |