Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / content / renderer / media / cdm_session_adapter.h
index 9c8ae0a..1756054 100644 (file)
@@ -17,6 +17,8 @@
 #include "content/renderer/media/crypto/pepper_cdm_wrapper.h"
 #endif
 
+class GURL;
+
 namespace content {
 
 class WebContentDecryptionModuleSessionImpl;
@@ -34,7 +36,8 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> {
 #if defined(ENABLE_PEPPER_CDMS)
       const CreatePepperCdmCB& create_pepper_cdm_cb,
 #endif
-      const std::string& key_system);
+      const std::string& key_system,
+      const GURL& security_origin);
 
   // Creates a new session and adds it to the internal map. The caller owns the
   // created session. RemoveSession() must be called when destroying it.
@@ -65,6 +68,12 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> {
   // after WebContentDecryptionModule is freed. http://crbug.com/330324
   media::Decryptor* GetDecryptor();
 
+#if defined(OS_ANDROID)
+  // Returns the CDM ID associated with the |media_keys_|. May be kInvalidCdmId
+  // if no CDM ID is associated.
+  int GetCdmId() const;
+#endif
+
  private:
   friend class base::RefCounted<CdmSessionAdapter>;
   typedef std::map<uint32, WebContentDecryptionModuleSessionImpl*> SessionMap;
@@ -85,12 +94,16 @@ class CdmSessionAdapter : public base::RefCounted<CdmSessionAdapter> {
   // Helper function of the callbacks.
   WebContentDecryptionModuleSessionImpl* GetSession(uint32 session_id);
 
+  // Session ID should be unique per renderer process for debugging purposes.
+  static uint32 next_session_id_;
+
   scoped_ptr<media::MediaKeys> media_keys_;
 
   SessionMap sessions_;
 
-  // Session ID should be unique per renderer process for debugging purposes.
-  static uint32 next_session_id_;
+#if defined(OS_ANDROID)
+  int cdm_id_;
+#endif
 
   // NOTE: Weak pointers must be invalidated before all other member variables.
   base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_;