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

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

Issue 17381007: EME: ProxyDecryptor creates MediaKeys instead of Decryptor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/crypto/aes_decryptor.h" 5 #include "media/crypto/aes_decryptor.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/stl_util.h" 10 #include "base/stl_util.h"
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 if (!new_video_key_cb_.is_null()) 207 if (!new_video_key_cb_.is_null())
208 new_video_key_cb_.Run(); 208 new_video_key_cb_.Run();
209 209
210 key_added_cb_.Run(key_system, session_id); 210 key_added_cb_.Run(key_system, session_id);
211 } 211 }
212 212
213 void AesDecryptor::CancelKeyRequest(const std::string& key_system, 213 void AesDecryptor::CancelKeyRequest(const std::string& key_system,
214 const std::string& session_id) { 214 const std::string& session_id) {
215 } 215 }
216 216
217 MediaKeys* AesDecryptor::GetMediaKeys() { 217 Decryptor* AesDecryptor::GetDecryptor() {
218 return this; 218 return this;
219 } 219 }
220 220
221 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type, 221 void AesDecryptor::RegisterNewKeyCB(StreamType stream_type,
222 const NewKeyCB& new_key_cb) { 222 const NewKeyCB& new_key_cb) {
223 switch (stream_type) { 223 switch (stream_type) {
224 case kAudio: 224 case kAudio:
225 new_audio_key_cb_ = new_key_cb; 225 new_audio_key_cb_ = new_key_cb;
226 break; 226 break;
227 case kVideo: 227 case kVideo:
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
332 bool AesDecryptor::DecryptionKey::Init() { 332 bool AesDecryptor::DecryptionKey::Init() {
333 CHECK(!secret_.empty()); 333 CHECK(!secret_.empty());
334 decryption_key_.reset(crypto::SymmetricKey::Import( 334 decryption_key_.reset(crypto::SymmetricKey::Import(
335 crypto::SymmetricKey::AES, secret_)); 335 crypto::SymmetricKey::AES, secret_));
336 if (!decryption_key_) 336 if (!decryption_key_)
337 return false; 337 return false;
338 return true; 338 return true;
339 } 339 }
340 340
341 } // namespace media 341 } // namespace media
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698