| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/mojo/services/mojo_cdm.h" | 5 #include "media/mojo/services/mojo_cdm.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 int MojoCdm::GetCdmId() const { | 177 int MojoCdm::GetCdmId() const { |
| 178 DCHECK_NE(CdmContext::kInvalidCdmId, cdm_id_); | 178 DCHECK_NE(CdmContext::kInvalidCdmId, cdm_id_); |
| 179 return cdm_id_; | 179 return cdm_id_; |
| 180 } | 180 } |
| 181 | 181 |
| 182 void MojoCdm::OnSessionMessage(const mojo::String& session_id, | 182 void MojoCdm::OnSessionMessage(const mojo::String& session_id, |
| 183 interfaces::CdmMessageType message_type, | 183 interfaces::CdmMessageType message_type, |
| 184 mojo::Array<uint8_t> message, | 184 mojo::Array<uint8_t> message, |
| 185 const mojo::String& legacy_destination_url) { | 185 const mojo::String& legacy_destination_url) { |
| 186 DVLOG(2) << __FUNCTION__; | 186 DVLOG(2) << __FUNCTION__; |
| 187 GURL verified_gurl = GURL(legacy_destination_url); | 187 GURL verified_gurl = GURL(legacy_destination_url.get()); |
| 188 if (!verified_gurl.is_valid() && !verified_gurl.is_empty()) { | 188 if (!verified_gurl.is_valid() && !verified_gurl.is_empty()) { |
| 189 DLOG(WARNING) << "SessionMessage destination_url is invalid : " | 189 DLOG(WARNING) << "SessionMessage destination_url is invalid : " |
| 190 << verified_gurl.possibly_invalid_spec(); | 190 << verified_gurl.possibly_invalid_spec(); |
| 191 verified_gurl = GURL::EmptyGURL(); // Replace invalid destination_url. | 191 verified_gurl = GURL::EmptyGURL(); // Replace invalid destination_url. |
| 192 } | 192 } |
| 193 | 193 |
| 194 session_message_cb_.Run(session_id, | 194 session_message_cb_.Run(session_id, |
| 195 static_cast<MediaKeys::MessageType>(message_type), | 195 static_cast<MediaKeys::MessageType>(message_type), |
| 196 message.storage(), verified_gurl); | 196 message.storage(), verified_gurl); |
| 197 } | 197 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 return; | 249 return; |
| 250 } | 250 } |
| 251 | 251 |
| 252 DCHECK_NE(CdmContext::kInvalidCdmId, cdm_id); | 252 DCHECK_NE(CdmContext::kInvalidCdmId, cdm_id); |
| 253 cdm_id_ = cdm_id; | 253 cdm_id_ = cdm_id; |
| 254 decryptor_ptr_ = std::move(decryptor); | 254 decryptor_ptr_ = std::move(decryptor); |
| 255 promise->resolve(); | 255 promise->resolve(); |
| 256 } | 256 } |
| 257 | 257 |
| 258 } // namespace media | 258 } // namespace media |
| OLD | NEW |