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 366 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 base::AutoLock auto_lock(key_map_lock_); | 377 base::AutoLock auto_lock(key_map_lock_); |
378 for (KeyIdToSessionKeysMap::iterator it = key_map_.begin(); | 378 for (KeyIdToSessionKeysMap::iterator it = key_map_.begin(); |
379 it != key_map_.end(); | 379 it != key_map_.end(); |
380 ++it) { | 380 ++it) { |
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 CdmContext* AesDecryptor::GetCdmContext() { |
| 388 return this; |
| 389 } |
| 390 |
387 Decryptor* AesDecryptor::GetDecryptor() { | 391 Decryptor* AesDecryptor::GetDecryptor() { |
388 return this; | 392 return this; |
389 } | 393 } |
390 | 394 |
391 #if defined(ENABLE_BROWSER_CDMS) | 395 #if defined(ENABLE_BROWSER_CDMS) |
392 int AesDecryptor::GetCdmId() const { | 396 int AesDecryptor::GetCdmId() const { |
393 return kInvalidCdmId; | 397 return kInvalidCdmId; |
394 } | 398 } |
395 #endif // defined(ENABLE_BROWSER_CDMS) | 399 #endif // defined(ENABLE_BROWSER_CDMS) |
396 | 400 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 bool AesDecryptor::DecryptionKey::Init() { | 548 bool AesDecryptor::DecryptionKey::Init() { |
545 CHECK(!secret_.empty()); | 549 CHECK(!secret_.empty()); |
546 decryption_key_.reset(crypto::SymmetricKey::Import( | 550 decryption_key_.reset(crypto::SymmetricKey::Import( |
547 crypto::SymmetricKey::AES, secret_)); | 551 crypto::SymmetricKey::AES, secret_)); |
548 if (!decryption_key_) | 552 if (!decryption_key_) |
549 return false; | 553 return false; |
550 return true; | 554 return true; |
551 } | 555 } |
552 | 556 |
553 } // namespace media | 557 } // namespace media |
OLD | NEW |