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 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
418 } | 418 } |
419 | 419 |
420 CdmContext* AesDecryptor::GetCdmContext() { | 420 CdmContext* AesDecryptor::GetCdmContext() { |
421 return this; | 421 return this; |
422 } | 422 } |
423 | 423 |
424 Decryptor* AesDecryptor::GetDecryptor() { | 424 Decryptor* AesDecryptor::GetDecryptor() { |
425 return this; | 425 return this; |
426 } | 426 } |
427 | 427 |
428 #if defined(ENABLE_BROWSER_CDMS) | |
429 int AesDecryptor::GetCdmId() const { | 428 int AesDecryptor::GetCdmId() const { |
430 return kInvalidCdmId; | 429 return kInvalidCdmId; |
431 } | 430 } |
432 #endif // defined(ENABLE_BROWSER_CDMS) | |
433 | 431 |
434 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, | 432 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, |
435 const NewKeyCB& new_key_cb) { | 433 const NewKeyCB& new_key_cb) { |
436 base::AutoLock auto_lock(new_key_cb_lock_); | 434 base::AutoLock auto_lock(new_key_cb_lock_); |
437 | 435 |
438 switch (stream_type) { | 436 switch (stream_type) { |
439 case kAudio: | 437 case kAudio: |
440 new_audio_key_cb_ = new_key_cb; | 438 new_audio_key_cb_ = new_key_cb; |
441 break; | 439 break; |
442 case kVideo: | 440 case kVideo: |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
591 bool AesDecryptor::DecryptionKey::Init() { | 589 bool AesDecryptor::DecryptionKey::Init() { |
592 CHECK(!secret_.empty()); | 590 CHECK(!secret_.empty()); |
593 decryption_key_.reset(crypto::SymmetricKey::Import( | 591 decryption_key_.reset(crypto::SymmetricKey::Import( |
594 crypto::SymmetricKey::AES, secret_)); | 592 crypto::SymmetricKey::AES, secret_)); |
595 if (!decryption_key_) | 593 if (!decryption_key_) |
596 return false; | 594 return false; |
597 return true; | 595 return true; |
598 } | 596 } |
599 | 597 |
600 } // namespace media | 598 } // namespace media |
OLD | NEW |