Chromium Code Reviews| 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 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 232 decrypted->SetDuration(encrypted->GetDuration()); | 232 decrypted->SetDuration(encrypted->GetDuration()); |
| 233 decrypt_cb.Run(kSuccess, decrypted); | 233 decrypt_cb.Run(kSuccess, decrypted); |
| 234 } | 234 } |
| 235 | 235 |
| 236 void AesDecryptor::CancelDecrypt(StreamType stream_type) { | 236 void AesDecryptor::CancelDecrypt(StreamType stream_type) { |
| 237 // Decrypt() calls the DecryptCB synchronously so there's nothing to cancel. | 237 // Decrypt() calls the DecryptCB synchronously so there's nothing to cancel. |
| 238 } | 238 } |
| 239 | 239 |
| 240 void AesDecryptor::InitializeAudioDecoder(scoped_ptr<AudioDecoderConfig> config, | 240 void AesDecryptor::InitializeAudioDecoder(scoped_ptr<AudioDecoderConfig> config, |
| 241 const DecoderInitCB& init_cb, | 241 const DecoderInitCB& init_cb, |
| 242 const KeyAddedCB& key_added_cb) { | 242 const OnKeyAddedCB& key_added_cb) { |
|
Ami GONE FROM CHROMIUM
2012/10/23 06:52:22
I wish you hadn't done all this renaming in a prot
xhwang
2012/10/23 07:32:13
Sorry for the noise. I realized that I need to do
| |
| 243 // AesDecryptor does not support audio decoding. | 243 // AesDecryptor does not support audio decoding. |
| 244 init_cb.Run(false); | 244 init_cb.Run(false); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void AesDecryptor::InitializeVideoDecoder(scoped_ptr<VideoDecoderConfig> config, | 247 void AesDecryptor::InitializeVideoDecoder(scoped_ptr<VideoDecoderConfig> config, |
| 248 const DecoderInitCB& init_cb, | 248 const DecoderInitCB& init_cb, |
| 249 const KeyAddedCB& key_added_cb) { | 249 const OnKeyAddedCB& key_added_cb) { |
| 250 // AesDecryptor does not support video decoding. | 250 // AesDecryptor does not support video decoding. |
| 251 init_cb.Run(false); | 251 init_cb.Run(false); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void AesDecryptor::DecryptAndDecodeAudio( | 254 void AesDecryptor::DecryptAndDecodeAudio( |
| 255 const scoped_refptr<DecoderBuffer>& encrypted, | 255 const scoped_refptr<DecoderBuffer>& encrypted, |
| 256 const AudioDecodeCB& audio_decode_cb) { | 256 const AudioDecodeCB& audio_decode_cb) { |
| 257 NOTREACHED() << "AesDecryptor does not support audio decoding"; | 257 NOTREACHED() << "AesDecryptor does not support audio decoding"; |
| 258 } | 258 } |
| 259 | 259 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 301 bool AesDecryptor::DecryptionKey::Init() { | 301 bool AesDecryptor::DecryptionKey::Init() { |
| 302 CHECK(!secret_.empty()); | 302 CHECK(!secret_.empty()); |
| 303 decryption_key_.reset(crypto::SymmetricKey::Import( | 303 decryption_key_.reset(crypto::SymmetricKey::Import( |
| 304 crypto::SymmetricKey::AES, secret_)); | 304 crypto::SymmetricKey::AES, secret_)); |
| 305 if (!decryption_key_.get()) | 305 if (!decryption_key_.get()) |
| 306 return false; | 306 return false; |
| 307 return true; | 307 return true; |
| 308 } | 308 } |
| 309 | 309 |
| 310 } // namespace media | 310 } // namespace media |
| OLD | NEW |