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 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 if (it->second->Contains(web_session_id)) | 381 if (it->second->Contains(web_session_id)) |
382 keyids.push_back(std::vector<uint8>(it->first.begin(), it->first.end())); | 382 keyids.push_back(std::vector<uint8>(it->first.begin(), it->first.end())); |
383 } | 383 } |
384 promise->resolve(keyids); | 384 promise->resolve(keyids); |
385 } | 385 } |
386 | 386 |
387 Decryptor* AesDecryptor::GetDecryptor() { | 387 Decryptor* AesDecryptor::GetDecryptor() { |
388 return this; | 388 return this; |
389 } | 389 } |
390 | 390 |
| 391 #if defined(ENABLE_BROWSER_CDMS) |
| 392 int AesDecryptor::GetCdmId() const { |
| 393 return kInvalidCdmId; |
| 394 } |
| 395 #endif // defined(ENABLE_BROWSER_CDMS) |
| 396 |
391 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, | 397 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, |
392 const NewKeyCB& new_key_cb) { | 398 const NewKeyCB& new_key_cb) { |
393 base::AutoLock auto_lock(new_key_cb_lock_); | 399 base::AutoLock auto_lock(new_key_cb_lock_); |
394 | 400 |
395 switch (stream_type) { | 401 switch (stream_type) { |
396 case kAudio: | 402 case kAudio: |
397 new_audio_key_cb_ = new_key_cb; | 403 new_audio_key_cb_ = new_key_cb; |
398 break; | 404 break; |
399 case kVideo: | 405 case kVideo: |
400 new_video_key_cb_ = new_key_cb; | 406 new_video_key_cb_ = new_key_cb; |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 bool AesDecryptor::DecryptionKey::Init() { | 544 bool AesDecryptor::DecryptionKey::Init() { |
539 CHECK(!secret_.empty()); | 545 CHECK(!secret_.empty()); |
540 decryption_key_.reset(crypto::SymmetricKey::Import( | 546 decryption_key_.reset(crypto::SymmetricKey::Import( |
541 crypto::SymmetricKey::AES, secret_)); | 547 crypto::SymmetricKey::AES, secret_)); |
542 if (!decryption_key_) | 548 if (!decryption_key_) |
543 return false; | 549 return false; |
544 return true; | 550 return true; |
545 } | 551 } |
546 | 552 |
547 } // namespace media | 553 } // namespace media |
OLD | NEW |