| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 promise->reject(NOT_SUPPORTED_ERROR, 0, | 302 promise->reject(NOT_SUPPORTED_ERROR, 0, |
| 303 "init_data_type not supported."); | 303 "init_data_type not supported."); |
| 304 return; | 304 return; |
| 305 } | 305 } |
| 306 CreateLicenseRequest(keys, session_type, &message); | 306 CreateLicenseRequest(keys, session_type, &message); |
| 307 } | 307 } |
| 308 | 308 |
| 309 promise->resolve(session_id); | 309 promise->resolve(session_id); |
| 310 | 310 |
| 311 // No URL needed for license requests. | 311 // No URL needed for license requests. |
| 312 GURL empty_gurl; | 312 session_message_cb_.Run(session_id, LICENSE_REQUEST, message, |
| 313 session_message_cb_.Run(session_id, LICENSE_REQUEST, message, empty_gurl); | 313 GURL::EmptyGURL()); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void AesDecryptor::LoadSession(SessionType session_type, | 316 void AesDecryptor::LoadSession(SessionType session_type, |
| 317 const std::string& session_id, | 317 const std::string& session_id, |
| 318 scoped_ptr<NewSessionCdmPromise> promise) { | 318 scoped_ptr<NewSessionCdmPromise> promise) { |
| 319 // TODO(xhwang): Change this to NOTREACHED() when blink checks for key systems | 319 // TODO(xhwang): Change this to NOTREACHED() when blink checks for key systems |
| 320 // that do not support loadSession. See http://crbug.com/342481 | 320 // that do not support loadSession. See http://crbug.com/342481 |
| 321 promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported."); | 321 promise->reject(NOT_SUPPORTED_ERROR, 0, "LoadSession() is not supported."); |
| 322 } | 322 } |
| 323 | 323 |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 bool AesDecryptor::DecryptionKey::Init() { | 604 bool AesDecryptor::DecryptionKey::Init() { |
| 605 CHECK(!secret_.empty()); | 605 CHECK(!secret_.empty()); |
| 606 decryption_key_.reset(crypto::SymmetricKey::Import( | 606 decryption_key_.reset(crypto::SymmetricKey::Import( |
| 607 crypto::SymmetricKey::AES, secret_)); | 607 crypto::SymmetricKey::AES, secret_)); |
| 608 if (!decryption_key_) | 608 if (!decryption_key_) |
| 609 return false; | 609 return false; |
| 610 return true; | 610 return true; |
| 611 } | 611 } |
| 612 | 612 |
| 613 } // namespace media | 613 } // namespace media |
| OLD | NEW |