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 MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ | 5 #ifndef MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ |
6 #define MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ | 6 #define MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 // Removes stored session data associated with the session specified by | 82 // Removes stored session data associated with the session specified by |
83 // |session_id|. | 83 // |session_id|. |
84 void RemoveSession(const std::string& session_id, | 84 void RemoveSession(const std::string& session_id, |
85 scoped_ptr<SimpleCdmPromise> promise); | 85 scoped_ptr<SimpleCdmPromise> promise); |
86 | 86 |
87 // Returns the CdmContext associated with |media_keys_|. | 87 // Returns the CdmContext associated with |media_keys_|. |
88 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor | 88 // TODO(jrummell): Figure out lifetimes, as WMPI may still use the decryptor |
89 // after WebContentDecryptionModule is freed. http://crbug.com/330324 | 89 // after WebContentDecryptionModule is freed. http://crbug.com/330324 |
90 CdmContext* GetCdmContext(); | 90 CdmContext* GetCdmContext(); |
91 | 91 |
| 92 // Returns the key system name. |
| 93 const std::string& GetKeySystem() const; |
| 94 |
92 // Returns a prefix to use for UMAs. | 95 // Returns a prefix to use for UMAs. |
93 const std::string& GetKeySystemUMAPrefix() const; | 96 const std::string& GetKeySystemUMAPrefix() const; |
94 | 97 |
95 private: | 98 private: |
96 friend class base::RefCounted<CdmSessionAdapter>; | 99 friend class base::RefCounted<CdmSessionAdapter>; |
97 typedef base::hash_map<std::string, | 100 typedef base::hash_map<std::string, |
98 base::WeakPtr<WebContentDecryptionModuleSessionImpl> > | 101 base::WeakPtr<WebContentDecryptionModuleSessionImpl> > |
99 SessionMap; | 102 SessionMap; |
100 | 103 |
101 ~CdmSessionAdapter(); | 104 ~CdmSessionAdapter(); |
(...skipping 15 matching lines...) Expand all Loading... |
117 const std::string& error_message); | 120 const std::string& error_message); |
118 | 121 |
119 // Helper function of the callbacks. | 122 // Helper function of the callbacks. |
120 WebContentDecryptionModuleSessionImpl* GetSession( | 123 WebContentDecryptionModuleSessionImpl* GetSession( |
121 const std::string& session_id); | 124 const std::string& session_id); |
122 | 125 |
123 scoped_ptr<MediaKeys> media_keys_; | 126 scoped_ptr<MediaKeys> media_keys_; |
124 | 127 |
125 SessionMap sessions_; | 128 SessionMap sessions_; |
126 | 129 |
| 130 std::string key_system_; |
127 std::string key_system_uma_prefix_; | 131 std::string key_system_uma_prefix_; |
128 | 132 |
129 // NOTE: Weak pointers must be invalidated before all other member variables. | 133 // NOTE: Weak pointers must be invalidated before all other member variables. |
130 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; | 134 base::WeakPtrFactory<CdmSessionAdapter> weak_ptr_factory_; |
131 | 135 |
132 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); | 136 DISALLOW_COPY_AND_ASSIGN(CdmSessionAdapter); |
133 }; | 137 }; |
134 | 138 |
135 } // namespace media | 139 } // namespace media |
136 | 140 |
137 #endif // MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ | 141 #endif // MEDIA_BLINK_CDM_SESSION_ADAPTER_H_ |
OLD | NEW |