Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: media/cdm/aes_decryptor.cc

Issue 748473002: Introduce CdmContext interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@set_cdm
Patch Set: Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698