| 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 #include "media/cdm/aes_decryptor.h" | 5 #include "media/cdm/aes_decryptor.h" |
| 6 | 6 |
| 7 #include <list> | 7 #include <list> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 368 } | 368 } |
| 369 | 369 |
| 370 CdmContext* AesDecryptor::GetCdmContext() { | 370 CdmContext* AesDecryptor::GetCdmContext() { |
| 371 return this; | 371 return this; |
| 372 } | 372 } |
| 373 | 373 |
| 374 Decryptor* AesDecryptor::GetDecryptor() { | 374 Decryptor* AesDecryptor::GetDecryptor() { |
| 375 return this; | 375 return this; |
| 376 } | 376 } |
| 377 | 377 |
| 378 #if defined(ENABLE_BROWSER_CDMS) | |
| 379 int AesDecryptor::GetCdmId() const { | 378 int AesDecryptor::GetCdmId() const { |
| 380 return kInvalidCdmId; | 379 return kInvalidCdmId; |
| 381 } | 380 } |
| 382 #endif // defined(ENABLE_BROWSER_CDMS) | |
| 383 | 381 |
| 384 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, | 382 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, |
| 385 const NewKeyCB& new_key_cb) { | 383 const NewKeyCB& new_key_cb) { |
| 386 base::AutoLock auto_lock(new_key_cb_lock_); | 384 base::AutoLock auto_lock(new_key_cb_lock_); |
| 387 | 385 |
| 388 switch (stream_type) { | 386 switch (stream_type) { |
| 389 case kAudio: | 387 case kAudio: |
| 390 new_audio_key_cb_ = new_key_cb; | 388 new_audio_key_cb_ = new_key_cb; |
| 391 break; | 389 break; |
| 392 case kVideo: | 390 case kVideo: |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 bool AesDecryptor::DecryptionKey::Init() { | 529 bool AesDecryptor::DecryptionKey::Init() { |
| 532 CHECK(!secret_.empty()); | 530 CHECK(!secret_.empty()); |
| 533 decryption_key_.reset(crypto::SymmetricKey::Import( | 531 decryption_key_.reset(crypto::SymmetricKey::Import( |
| 534 crypto::SymmetricKey::AES, secret_)); | 532 crypto::SymmetricKey::AES, secret_)); |
| 535 if (!decryption_key_) | 533 if (!decryption_key_) |
| 536 return false; | 534 return false; |
| 537 return true; | 535 return true; |
| 538 } | 536 } |
| 539 | 537 |
| 540 } // namespace media | 538 } // namespace media |
| OLD | NEW |