| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "media/crypto/aes_decryptor.h" | 5 #include "media/crypto/aes_decryptor.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 | 204 |
| 205 if (!new_video_key_cb_.is_null()) | 205 if (!new_video_key_cb_.is_null()) |
| 206 new_video_key_cb_.Run(); | 206 new_video_key_cb_.Run(); |
| 207 | 207 |
| 208 key_added_cb_.Run(session_id); | 208 key_added_cb_.Run(session_id); |
| 209 } | 209 } |
| 210 | 210 |
| 211 void AesDecryptor::CancelKeyRequest(const std::string& session_id) { | 211 void AesDecryptor::CancelKeyRequest(const std::string& session_id) { |
| 212 } | 212 } |
| 213 | 213 |
| 214 MediaKeys* AesDecryptor::GetMediaKeys() { | 214 Decryptor* AesDecryptor::GetDecryptor() { |
| 215 return this; | 215 return this; |
| 216 } | 216 } |
| 217 | 217 |
| 218 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, | 218 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, |
| 219 const NewKeyCB& new_key_cb) { | 219 const NewKeyCB& new_key_cb) { |
| 220 switch (stream_type) { | 220 switch (stream_type) { |
| 221 case kAudio: | 221 case kAudio: |
| 222 new_audio_key_cb_ = new_key_cb; | 222 new_audio_key_cb_ = new_key_cb; |
| 223 break; | 223 break; |
| 224 case kVideo: | 224 case kVideo: |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 329 bool AesDecryptor::DecryptionKey::Init() { | 329 bool AesDecryptor::DecryptionKey::Init() { |
| 330 CHECK(!secret_.empty()); | 330 CHECK(!secret_.empty()); |
| 331 decryption_key_.reset(crypto::SymmetricKey::Import( | 331 decryption_key_.reset(crypto::SymmetricKey::Import( |
| 332 crypto::SymmetricKey::AES, secret_)); | 332 crypto::SymmetricKey::AES, secret_)); |
| 333 if (!decryption_key_) | 333 if (!decryption_key_) |
| 334 return false; | 334 return false; |
| 335 return true; | 335 return true; |
| 336 } | 336 } |
| 337 | 337 |
| 338 } // namespace media | 338 } // namespace media |
| OLD | NEW |