| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_CDM_AES_DECRYPTOR_H_ | 5 #ifndef MEDIA_CDM_AES_DECRYPTOR_H_ |
| 6 #define MEDIA_CDM_AES_DECRYPTOR_H_ | 6 #define MEDIA_CDM_AES_DECRYPTOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 139 SessionMessageCB session_message_cb_; | 139 SessionMessageCB session_message_cb_; |
| 140 SessionClosedCB session_closed_cb_; | 140 SessionClosedCB session_closed_cb_; |
| 141 SessionKeysChangeCB session_keys_change_cb_; | 141 SessionKeysChangeCB session_keys_change_cb_; |
| 142 | 142 |
| 143 // Since only Decrypt() is called off the renderer thread, we only need to | 143 // Since only Decrypt() is called off the renderer thread, we only need to |
| 144 // protect |key_map_|, the only member variable that is shared between | 144 // protect |key_map_|, the only member variable that is shared between |
| 145 // Decrypt() and other methods. | 145 // Decrypt() and other methods. |
| 146 KeyIdToSessionKeysMap key_map_; // Protected by |key_map_lock_|. | 146 KeyIdToSessionKeysMap key_map_; // Protected by |key_map_lock_|. |
| 147 mutable base::Lock key_map_lock_; // Protects the |key_map_|. | 147 mutable base::Lock key_map_lock_; // Protects the |key_map_|. |
| 148 | 148 |
| 149 // Keeps track of current valid sessions. | 149 // Keeps track of current open sessions. |
| 150 std::set<std::string> valid_sessions_; | 150 std::set<std::string> open_sessions_; |
| 151 | 151 |
| 152 // Make session ID unique per renderer by making it static. Session | 152 // Make session ID unique per renderer by making it static. Session |
| 153 // IDs seen by the app will be "1", "2", etc. | 153 // IDs seen by the app will be "1", "2", etc. |
| 154 static uint32_t next_session_id_; | 154 static uint32_t next_session_id_; |
| 155 | 155 |
| 156 NewKeyCB new_audio_key_cb_; | 156 NewKeyCB new_audio_key_cb_; |
| 157 NewKeyCB new_video_key_cb_; | 157 NewKeyCB new_video_key_cb_; |
| 158 | 158 |
| 159 // Protect |new_audio_key_cb_| and |new_video_key_cb_| as they are set on the | 159 // Protect |new_audio_key_cb_| and |new_video_key_cb_| as they are set on the |
| 160 // main thread but called on the media thread. | 160 // main thread but called on the media thread. |
| 161 mutable base::Lock new_key_cb_lock_; | 161 mutable base::Lock new_key_cb_lock_; |
| 162 | 162 |
| 163 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); | 163 DISALLOW_COPY_AND_ASSIGN(AesDecryptor); |
| 164 }; | 164 }; |
| 165 | 165 |
| 166 } // namespace media | 166 } // namespace media |
| 167 | 167 |
| 168 #endif // MEDIA_CDM_AES_DECRYPTOR_H_ | 168 #endif // MEDIA_CDM_AES_DECRYPTOR_H_ |
| OLD | NEW |