| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ | 5 #ifndef CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ | 6 #define CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 81 // Takes ownership of |promise|. | 81 // Takes ownership of |promise|. |
| 82 void ReleaseSession(const std::string& web_session_id, | 82 void ReleaseSession(const std::string& web_session_id, |
| 83 scoped_ptr<media::SimpleCdmPromise> promise); | 83 scoped_ptr<media::SimpleCdmPromise> promise); |
| 84 | 84 |
| 85 // Returns the Decryptor associated with this CDM. May be NULL if no | 85 // Returns the Decryptor associated with this CDM. May be NULL if no |
| 86 // Decryptor is associated with the MediaKeys object. | 86 // Decryptor is associated with the MediaKeys object. |
| 87 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor | 87 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor |
| 88 // after WebContentDecryptionModule is freed. http://crbug.com/330324 | 88 // after WebContentDecryptionModule is freed. http://crbug.com/330324 |
| 89 media::Decryptor* GetDecryptor(); | 89 media::Decryptor* GetDecryptor(); |
| 90 | 90 |
| 91 // Returns a prefix to use for UMAs. |
| 92 const std::string& GetKeySystemUMAPrefix() const; |
| 93 |
| 91 #if defined(ENABLE_BROWSER_CDMS) | 94 #if defined(ENABLE_BROWSER_CDMS) |
| 92 // Returns the CDM ID associated with the |media_keys_|. May be kInvalidCdmId | 95 // Returns the CDM ID associated with the |media_keys_|. May be kInvalidCdmId |
| 93 // if no CDM ID is associated. | 96 // if no CDM ID is associated. |
| 94 int GetCdmId() const; | 97 int GetCdmId() const; |
| 95 #endif | 98 #endif |
| 96 | 99 |
| 97 private: | 100 private: |
| 98 friend class base::RefCounted<CdmSessionAdapter>; | 101 friend class base::RefCounted<CdmSessionAdapter>; |
| 99 typedef base::hash_map<std::string, | 102 typedef base::hash_map<std::string, |
| 100 base::WeakPtr<WebContentDecryptionModuleSessionImpl> > | 103 base::WeakPtr<WebContentDecryptionModuleSessionImpl> > |
| (...skipping 17 matching lines...) Expand all Loading... |
| 118 const std::string& web_session_id); | 121 const std::string& web_session_id); |
| 119 | 122 |
| 120 scoped_ptr<media::MediaKeys> media_keys_; | 123 scoped_ptr<media::MediaKeys> media_keys_; |
| 121 | 124 |
| 122 SessionMap sessions_; | 125 SessionMap sessions_; |
| 123 | 126 |
| 124 #if defined(ENABLE_BROWSER_CDMS) | 127 #if defined(ENABLE_BROWSER_CDMS) |
| 125 int cdm_id_; | 128 int cdm_id_; |
| 126 #endif | 129 #endif |
| 127 | 130 |
| 131 std::string key_system_uma_prefix_; |
| 132 |
| 128 // NOTE: Weak pointers must be invalidated before all other member variables. | 133 // NOTE: Weak pointers must be invalidated before all other member variables. |
| 129 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; | 134 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; |
| 130 | 135 |
| 131 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); | 136 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); |
| 132 }; | 137 }; |
| 133 | 138 |
| 134 } // namespace content | 139 } // namespace content |
| 135 | 140 |
| 136 #endif // CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ | 141 #endif // CONTENT_RENDERER_MEDIA_CDM_SESSION_ADAPTER_H_ |
| OLD | NEW |