| 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/ppapi/cdm_adapter.h" | 5 #include "media/cdm/ppapi/cdm_adapter.h" |
| 6 | 6 |
| 7 #include "media/cdm/ppapi/cdm_file_io_impl.h" | 7 #include "media/cdm/ppapi/cdm_file_io_impl.h" |
| 8 #include "media/cdm/ppapi/cdm_helpers.h" | 8 #include "media/cdm/ppapi/cdm_helpers.h" |
| 9 #include "media/cdm/ppapi/cdm_logging.h" | 9 #include "media/cdm/ppapi/cdm_logging.h" |
| 10 #include "media/cdm/ppapi/supported_cdm_versions.h" | 10 #include "media/cdm/ppapi/supported_cdm_versions.h" |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 PP_DCHECK(response_ptr); | 376 PP_DCHECK(response_ptr); |
| 377 PP_DCHECK(response_size > 0); | 377 PP_DCHECK(response_size > 0); |
| 378 | 378 |
| 379 cdm_->UpdateSession(promise_id, | 379 cdm_->UpdateSession(promise_id, |
| 380 web_session_id.data(), | 380 web_session_id.data(), |
| 381 web_session_id.length(), | 381 web_session_id.length(), |
| 382 response_ptr, | 382 response_ptr, |
| 383 response_size); | 383 response_size); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void CdmAdapter::ReleaseSession(uint32_t promise_id, | 386 void CdmAdapter::CloseSession(uint32_t promise_id, |
| 387 const std::string& web_session_id) { | 387 const std::string& web_session_id) { |
| 388 cdm_->CloseSession( | 388 if (!cdm_->CloseSession( |
| 389 promise_id, web_session_id.data(), web_session_id.length()); | |
| 390 } | |
| 391 | |
| 392 void CdmAdapter::RemoveSession(uint32_t promise_id, | |
| 393 const std::string& web_session_id) { | |
| 394 if (!cdm_->RemoveSession( | |
| 395 promise_id, web_session_id.data(), web_session_id.length())) { | 389 promise_id, web_session_id.data(), web_session_id.length())) { |
| 396 // CDM_4 and CDM_5 don't support this method, so reject the promise. | 390 // CDM_4 and CDM_5 don't support this method, so reject the promise. |
| 397 RejectPromise(promise_id, cdm::kNotSupportedError, 0, "Not implemented."); | 391 RejectPromise(promise_id, cdm::kNotSupportedError, 0, "Not implemented."); |
| 398 } | 392 } |
| 399 } | 393 } |
| 400 | 394 |
| 395 void CdmAdapter::ReleaseSession(uint32_t promise_id, |
| 396 const std::string& web_session_id) { |
| 397 cdm_->RemoveSession( |
| 398 promise_id, web_session_id.data(), web_session_id.length()); |
| 399 } |
| 400 |
| 401 void CdmAdapter::GetUsableKeyIds(uint32_t promise_id, | 401 void CdmAdapter::GetUsableKeyIds(uint32_t promise_id, |
| 402 const std::string& web_session_id) { | 402 const std::string& web_session_id) { |
| 403 if (!cdm_->GetUsableKeyIds( | 403 if (!cdm_->GetUsableKeyIds( |
| 404 promise_id, web_session_id.data(), web_session_id.length())) { | 404 promise_id, web_session_id.data(), web_session_id.length())) { |
| 405 // CDM_4 and CDM_5 don't support this method, so reject the promise. | 405 // CDM_4 and CDM_5 don't support this method, so reject the promise. |
| 406 RejectPromise(promise_id, cdm::kNotSupportedError, 0, "Not implemented."); | 406 RejectPromise(promise_id, cdm::kNotSupportedError, 0, "Not implemented."); |
| 407 } | 407 } |
| 408 } | 408 } |
| 409 | 409 |
| 410 // Note: In the following decryption/decoding related functions, errors are NOT | 410 // Note: In the following decryption/decoding related functions, errors are NOT |
| (...skipping 946 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1357 } // namespace media | 1357 } // namespace media |
| 1358 | 1358 |
| 1359 namespace pp { | 1359 namespace pp { |
| 1360 | 1360 |
| 1361 // Factory function for your specialization of the Module object. | 1361 // Factory function for your specialization of the Module object. |
| 1362 Module* CreateModule() { | 1362 Module* CreateModule() { |
| 1363 return new media::CdmAdapterModule(); | 1363 return new media::CdmAdapterModule(); |
| 1364 } | 1364 } |
| 1365 | 1365 |
| 1366 } // namespace pp | 1366 } // namespace pp |
| OLD | NEW |