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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
258 // For now, the AesDecryptor does not care about |init_data_type| or | 258 // For now, the AesDecryptor does not care about |init_data_type| or |
259 // |session_type|; just resolve the promise and then fire a message event | 259 // |session_type|; just resolve the promise and then fire a message event |
260 // using the |init_data| as the key ID in the license request. | 260 // using the |init_data| as the key ID in the license request. |
261 // TODO(jrummell): Validate |init_data_type| and |session_type|. | 261 // TODO(jrummell): Validate |init_data_type| and |session_type|. |
262 std::vector<uint8> message; | 262 std::vector<uint8> message; |
263 if (init_data && init_data_length) | 263 if (init_data && init_data_length) |
264 CreateLicenseRequest(init_data, init_data_length, session_type, &message); | 264 CreateLicenseRequest(init_data, init_data_length, session_type, &message); |
265 | 265 |
266 promise->resolve(web_session_id); | 266 promise->resolve(web_session_id); |
267 | 267 |
268 session_message_cb_.Run(web_session_id, LICENSE_REQUEST, message); | 268 session_message_cb_.Run(web_session_id, LICENSE_REQUEST, message, |
269 GURL::EmptyGURL()); | |
dmichael (off chromium)
2015/01/13 21:15:15
This is weird-looking enough to warrant a comment.
jrummell
2015/01/13 21:41:44
Done.
| |
269 } | 270 } |
270 | 271 |
271 void AesDecryptor::LoadSession(SessionType session_type, | 272 void AesDecryptor::LoadSession(SessionType session_type, |
272 const std::string& web_session_id, | 273 const std::string& web_session_id, |
273 scoped_ptr<NewSessionCdmPromise> promise) { | 274 scoped_ptr<NewSessionCdmPromise> promise) { |
274 // TODO(xhwang): Change this to NOTREACHED() when blink checks for key systems | 275 // TODO(xhwang): Change this to NOTREACHED() when blink checks for key systems |
275 // that do not support loadSession. See http://crbug.com/342481 | 276 // that do not support loadSession. See http://crbug.com/342481 |
276 promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported."); | 277 promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported."); |
277 } | 278 } |
278 | 279 |
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
547 bool AesDecryptor::DecryptionKey::Init() { | 548 bool AesDecryptor::DecryptionKey::Init() { |
548 CHECK(!secret_.empty()); | 549 CHECK(!secret_.empty()); |
549 decryption_key_.reset(crypto::SymmetricKey::Import( | 550 decryption_key_.reset(crypto::SymmetricKey::Import( |
550 crypto::SymmetricKey::AES, secret_)); | 551 crypto::SymmetricKey::AES, secret_)); |
551 if (!decryption_key_) | 552 if (!decryption_key_) |
552 return false; | 553 return false; |
553 return true; | 554 return true; |
554 } | 555 } |
555 | 556 |
556 } // namespace media | 557 } // namespace media |
OLD | NEW |