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_service.h" | 5 #include "media/mojo/services/mojo_cdm_service.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <utility> | 8 #include <utility> |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 client_->OnSessionMessage(session_id, message_type, message); | 169 client_->OnSessionMessage(session_id, message_type, message); |
170 } | 170 } |
171 | 171 |
172 void MojoCdmService::OnSessionKeysChange(const std::string& session_id, | 172 void MojoCdmService::OnSessionKeysChange(const std::string& session_id, |
173 bool has_additional_usable_key, | 173 bool has_additional_usable_key, |
174 CdmKeysInfo keys_info) { | 174 CdmKeysInfo keys_info) { |
175 DVLOG(2) << __func__ | 175 DVLOG(2) << __func__ |
176 << " has_additional_usable_key=" << has_additional_usable_key; | 176 << " has_additional_usable_key=" << has_additional_usable_key; |
177 | 177 |
178 std::vector<mojom::CdmKeyInformationPtr> keys_data; | 178 std::vector<mojom::CdmKeyInformationPtr> keys_data; |
179 for (auto* key : keys_info) | 179 for (auto& key : keys_info) |
180 keys_data.push_back(mojom::CdmKeyInformation::From(*key)); | 180 keys_data.push_back(mojom::CdmKeyInformation::From(*(key.get()))); |
181 client_->OnSessionKeysChange(session_id, has_additional_usable_key, | 181 client_->OnSessionKeysChange(session_id, has_additional_usable_key, |
182 std::move(keys_data)); | 182 std::move(keys_data)); |
183 } | 183 } |
184 | 184 |
185 void MojoCdmService::OnSessionExpirationUpdate(const std::string& session_id, | 185 void MojoCdmService::OnSessionExpirationUpdate(const std::string& session_id, |
186 base::Time new_expiry_time_sec) { | 186 base::Time new_expiry_time_sec) { |
187 DVLOG(2) << __func__ << " expiry=" << new_expiry_time_sec; | 187 DVLOG(2) << __func__ << " expiry=" << new_expiry_time_sec; |
188 client_->OnSessionExpirationUpdate(session_id, | 188 client_->OnSessionExpirationUpdate(session_id, |
189 new_expiry_time_sec.ToDoubleT()); | 189 new_expiry_time_sec.ToDoubleT()); |
190 } | 190 } |
191 | 191 |
192 void MojoCdmService::OnSessionClosed(const std::string& session_id) { | 192 void MojoCdmService::OnSessionClosed(const std::string& session_id) { |
193 DVLOG(2) << __func__; | 193 DVLOG(2) << __func__; |
194 client_->OnSessionClosed(session_id); | 194 client_->OnSessionClosed(session_id); |
195 } | 195 } |
196 | 196 |
197 void MojoCdmService::OnDecryptorConnectionError() { | 197 void MojoCdmService::OnDecryptorConnectionError() { |
198 DVLOG(2) << __func__; | 198 DVLOG(2) << __func__; |
199 | 199 |
200 // MojoDecryptorService has lost connectivity to it's client, so it can be | 200 // MojoDecryptorService has lost connectivity to it's client, so it can be |
201 // freed. | 201 // freed. |
202 decryptor_.reset(); | 202 decryptor_.reset(); |
203 } | 203 } |
204 | 204 |
205 } // namespace media | 205 } // namespace media |
OLD | NEW |