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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
574 system_code)); | 574 system_code)); |
575 } | 575 } |
576 | 576 |
577 void CdmAdapter::SendSessionCreatedInternal(int32_t result, | 577 void CdmAdapter::SendSessionCreatedInternal(int32_t result, |
578 uint32_t session_id, | 578 uint32_t session_id, |
579 const std::string& web_session_id) { | 579 const std::string& web_session_id) { |
580 PP_DCHECK(result == PP_OK); | 580 PP_DCHECK(result == PP_OK); |
581 pp::ContentDecryptor_Private::SessionCreated(session_id, web_session_id); | 581 pp::ContentDecryptor_Private::SessionCreated(session_id, web_session_id); |
582 } | 582 } |
583 | 583 |
584 void CdmAdapter::SendSessionMessageInternal(int32_t result, | 584 void CdmAdapter::SendSessionMessageInternal( |
585 uint32_t session_id, | 585 int32_t result, |
586 const std::vector<uint8>& message, | 586 uint32_t session_id, |
587 const std::string& default_url) { | 587 const std::vector<uint8>& message, |
| 588 const std::string& destination_url) { |
588 PP_DCHECK(result == PP_OK); | 589 PP_DCHECK(result == PP_OK); |
589 | 590 |
590 pp::VarArrayBuffer message_array_buffer(message.size()); | 591 pp::VarArrayBuffer message_array_buffer(message.size()); |
591 if (message.size() > 0) { | 592 if (message.size() > 0) { |
592 memcpy(message_array_buffer.Map(), message.data(), message.size()); | 593 memcpy(message_array_buffer.Map(), message.data(), message.size()); |
593 } | 594 } |
594 | 595 |
595 pp::ContentDecryptor_Private::SessionMessage( | 596 pp::ContentDecryptor_Private::SessionMessage( |
596 session_id, message_array_buffer, default_url); | 597 session_id, message_array_buffer, destination_url); |
597 } | 598 } |
598 | 599 |
599 void CdmAdapter::SendSessionReadyInternal(int32_t result, uint32_t session_id) { | 600 void CdmAdapter::SendSessionReadyInternal(int32_t result, uint32_t session_id) { |
600 PP_DCHECK(result == PP_OK); | 601 PP_DCHECK(result == PP_OK); |
601 pp::ContentDecryptor_Private::SessionReady(session_id); | 602 pp::ContentDecryptor_Private::SessionReady(session_id); |
602 } | 603 } |
603 | 604 |
604 void CdmAdapter::SendSessionClosedInternal(int32_t result, | 605 void CdmAdapter::SendSessionClosedInternal(int32_t result, |
605 uint32_t session_id) { | 606 uint32_t session_id) { |
606 PP_DCHECK(result == PP_OK); | 607 PP_DCHECK(result == PP_OK); |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1037 } // namespace media | 1038 } // namespace media |
1038 | 1039 |
1039 namespace pp { | 1040 namespace pp { |
1040 | 1041 |
1041 // Factory function for your specialization of the Module object. | 1042 // Factory function for your specialization of the Module object. |
1042 Module* CreateModule() { | 1043 Module* CreateModule() { |
1043 return new media::CdmAdapterModule(); | 1044 return new media::CdmAdapterModule(); |
1044 } | 1045 } |
1045 | 1046 |
1046 } // namespace pp | 1047 } // namespace pp |
OLD | NEW |