| 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 "content/browser/media/cdm/browser_cdm_manager.h" | 5 #include "content/browser/media/cdm/browser_cdm_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 329 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 340 exception_code, system_code, | 340 exception_code, system_code, |
| 341 error_message)); | 341 error_message)); |
| 342 } | 342 } |
| 343 | 343 |
| 344 void BrowserCdmManager::OnSessionKeysChange(int render_frame_id, | 344 void BrowserCdmManager::OnSessionKeysChange(int render_frame_id, |
| 345 int cdm_id, | 345 int cdm_id, |
| 346 const std::string& session_id, | 346 const std::string& session_id, |
| 347 bool has_additional_usable_key, | 347 bool has_additional_usable_key, |
| 348 media::CdmKeysInfo keys_info) { | 348 media::CdmKeysInfo keys_info) { |
| 349 std::vector<media::CdmKeyInformation> key_info_vector; | 349 std::vector<media::CdmKeyInformation> key_info_vector; |
| 350 for (const auto& key_info : keys_info) | 350 for (auto* key_info : keys_info) |
| 351 key_info_vector.push_back(*key_info); | 351 key_info_vector.push_back(*key_info); |
| 352 Send(new CdmMsg_SessionKeysChange(render_frame_id, cdm_id, session_id, | 352 Send(new CdmMsg_SessionKeysChange(render_frame_id, cdm_id, session_id, |
| 353 has_additional_usable_key, | 353 has_additional_usable_key, |
| 354 key_info_vector)); | 354 key_info_vector)); |
| 355 } | 355 } |
| 356 | 356 |
| 357 void BrowserCdmManager::OnSessionExpirationUpdate( | 357 void BrowserCdmManager::OnSessionExpirationUpdate( |
| 358 int render_frame_id, | 358 int render_frame_id, |
| 359 int cdm_id, | 359 int cdm_id, |
| 360 const std::string& session_id, | 360 const std::string& session_id, |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 729 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); | 729 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); |
| 730 if (!cdm) { | 730 if (!cdm) { |
| 731 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); | 731 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); |
| 732 return; | 732 return; |
| 733 } | 733 } |
| 734 | 734 |
| 735 cdm->LoadSession(session_type, session_id, std::move(promise)); | 735 cdm->LoadSession(session_type, session_id, std::move(promise)); |
| 736 } | 736 } |
| 737 | 737 |
| 738 } // namespace content | 738 } // namespace content |
| OLD | NEW |