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/external_clear_key/clear_key_cdm.h" | 5 #include "media/cdm/ppapi/external_clear_key/clear_key_cdm.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <cstring> | 8 #include <cstring> |
9 #include <sstream> | 9 #include <sstream> |
10 #include <string> | 10 #include <string> |
(...skipping 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 base::Unretained(this), | 664 base::Unretained(this), |
665 promise_id_for_emulated_loadsession_))); | 665 promise_id_for_emulated_loadsession_))); |
666 decryptor_.UpdateSession(session_id_for_emulated_loadsession_, | 666 decryptor_.UpdateSession(session_id_for_emulated_loadsession_, |
667 reinterpret_cast<const uint8*>(jwk_set.data()), | 667 reinterpret_cast<const uint8*>(jwk_set.data()), |
668 jwk_set.size(), | 668 jwk_set.size(), |
669 promise.Pass()); | 669 promise.Pass()); |
670 } | 670 } |
671 | 671 |
672 void ClearKeyCdm::OnSessionMessage(const std::string& web_session_id, | 672 void ClearKeyCdm::OnSessionMessage(const std::string& web_session_id, |
673 MediaKeys::MessageType message_type, | 673 MediaKeys::MessageType message_type, |
674 const std::vector<uint8>& message) { | 674 const std::vector<uint8>& message, |
| 675 const GURL& legacy_destination_url) { |
675 DVLOG(1) << "OnSessionMessage: " << message.size(); | 676 DVLOG(1) << "OnSessionMessage: " << message.size(); |
676 | 677 |
677 // Ignore the message when we are waiting to update the loadable session. | 678 // Ignore the message when we are waiting to update the loadable session. |
678 if (web_session_id == session_id_for_emulated_loadsession_) | 679 if (web_session_id == session_id_for_emulated_loadsession_) |
679 return; | 680 return; |
680 | 681 |
681 // OnSessionMessage() only called during CreateSession(), so no promise | 682 // OnSessionMessage() only called during CreateSession(), so no promise |
682 // involved (OnSessionCreated() called to resolve the CreateSession() | 683 // involved (OnSessionCreated() called to resolve the CreateSession() |
683 // promise). | 684 // promise). |
684 // TODO(jrummell): Pass |message_type| on when this class is updated | 685 // TODO(jrummell): Pass |message_type| on when this class is updated |
685 // to Host_7. For now, pass NULL as the |destination_url| since we have | 686 // to Host_7. |
686 // no idea what it should be. | 687 host_->OnSessionMessage(web_session_id.data(), web_session_id.length(), |
687 host_->OnSessionMessage(web_session_id.data(), | |
688 web_session_id.length(), | |
689 reinterpret_cast<const char*>(message.data()), | 688 reinterpret_cast<const char*>(message.data()), |
690 message.size(), | 689 message.size(), legacy_destination_url.spec().data(), |
691 nullptr, 0); | 690 legacy_destination_url.spec().size()); |
692 } | 691 } |
693 | 692 |
694 void ClearKeyCdm::OnSessionKeysChange(const std::string& web_session_id, | 693 void ClearKeyCdm::OnSessionKeysChange(const std::string& web_session_id, |
695 bool has_additional_usable_key, | 694 bool has_additional_usable_key, |
696 CdmKeysInfo keys_info) { | 695 CdmKeysInfo keys_info) { |
697 // Ignore the message when we are waiting to update the loadable session. | 696 // Ignore the message when we are waiting to update the loadable session. |
698 if (web_session_id == session_id_for_emulated_loadsession_) | 697 if (web_session_id == session_id_for_emulated_loadsession_) |
699 return; | 698 return; |
700 | 699 |
701 // TODO(jrummell): Pass |keys_info| on. | 700 // TODO(jrummell): Pass |keys_info| on. |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 host_->OnSessionMessage(last_session_id_.data(), | 843 host_->OnSessionMessage(last_session_id_.data(), |
845 last_session_id_.length(), | 844 last_session_id_.length(), |
846 message.data(), | 845 message.data(), |
847 message.length(), | 846 message.length(), |
848 NULL, | 847 NULL, |
849 0); | 848 0); |
850 file_io_test_runner_.reset(); | 849 file_io_test_runner_.reset(); |
851 } | 850 } |
852 | 851 |
853 } // namespace media | 852 } // namespace media |
OLD | NEW |