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/clients/mojo_cdm.h" | 5 #include "media/mojo/clients/mojo_cdm.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 DCHECK(decryptor_task_runner_); | 314 DCHECK(decryptor_task_runner_); |
315 decryptor_task_runner_->PostTask( | 315 decryptor_task_runner_->PostTask( |
316 FROM_HERE, | 316 FROM_HERE, |
317 base::Bind(&MojoCdm::OnKeyAdded, weak_factory_.GetWeakPtr())); | 317 base::Bind(&MojoCdm::OnKeyAdded, weak_factory_.GetWeakPtr())); |
318 } | 318 } |
319 } | 319 } |
320 | 320 |
321 CdmKeysInfo key_data; | 321 CdmKeysInfo key_data; |
322 key_data.reserve(keys_info.size()); | 322 key_data.reserve(keys_info.size()); |
323 for (size_t i = 0; i < keys_info.size(); ++i) { | 323 for (size_t i = 0; i < keys_info.size(); ++i) { |
324 key_data.push_back( | 324 key_data.push_back(keys_info[i].To<std::unique_ptr<CdmKeyInformation>>()); |
325 keys_info[i].To<std::unique_ptr<CdmKeyInformation>>().release()); | |
326 } | 325 } |
327 session_keys_change_cb_.Run(session_id, has_additional_usable_key, | 326 session_keys_change_cb_.Run(session_id, has_additional_usable_key, |
328 std::move(key_data)); | 327 std::move(key_data)); |
329 } | 328 } |
330 | 329 |
331 void MojoCdm::OnSessionExpirationUpdate(const std::string& session_id, | 330 void MojoCdm::OnSessionExpirationUpdate(const std::string& session_id, |
332 double new_expiry_time_sec) { | 331 double new_expiry_time_sec) { |
333 DVLOG(2) << __func__; | 332 DVLOG(2) << __func__; |
334 DCHECK(thread_checker_.CalledOnValidThread()); | 333 DCHECK(thread_checker_.CalledOnValidThread()); |
335 | 334 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
390 cdm_session_tracker_.AddSession(session_id); | 389 cdm_session_tracker_.AddSession(session_id); |
391 cdm_promise_adapter_.ResolvePromise(promise_id, session_id); | 390 cdm_promise_adapter_.ResolvePromise(promise_id, session_id); |
392 } else { | 391 } else { |
393 cdm_promise_adapter_.RejectPromise(promise_id, result->exception, | 392 cdm_promise_adapter_.RejectPromise(promise_id, result->exception, |
394 result->system_code, | 393 result->system_code, |
395 result->error_message); | 394 result->error_message); |
396 } | 395 } |
397 } | 396 } |
398 | 397 |
399 } // namespace media | 398 } // namespace media |
OLD | NEW |