| 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 #include <string> | 8 #include <string> |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 web_contents->GetBrowserContext()->GetPermissionManager(); | 663 web_contents->GetBrowserContext()->GetPermissionManager(); |
| 664 if (!permission_manager) { | 664 if (!permission_manager) { |
| 665 permission_status_cb.Run(false); | 665 permission_status_cb.Run(false); |
| 666 return; | 666 return; |
| 667 } | 667 } |
| 668 | 668 |
| 669 PermissionStatus permission_status = permission_manager->GetPermissionStatus( | 669 PermissionStatus permission_status = permission_manager->GetPermissionStatus( |
| 670 PermissionType::PROTECTED_MEDIA_IDENTIFIER, security_origin, | 670 PermissionType::PROTECTED_MEDIA_IDENTIFIER, security_origin, |
| 671 web_contents->GetLastCommittedURL().GetOrigin()); | 671 web_contents->GetLastCommittedURL().GetOrigin()); |
| 672 | 672 |
| 673 bool allowed = (permission_status == PERMISSION_STATUS_GRANTED); | 673 bool allowed = (permission_status == PermissionStatus::GRANTED); |
| 674 if (!task_runner_->RunsTasksOnCurrentThread()) { | 674 if (!task_runner_->RunsTasksOnCurrentThread()) { |
| 675 task_runner_->PostTask(FROM_HERE, | 675 task_runner_->PostTask(FROM_HERE, |
| 676 base::Bind(permission_status_cb, allowed)); | 676 base::Bind(permission_status_cb, allowed)); |
| 677 } else { | 677 } else { |
| 678 permission_status_cb.Run(allowed); | 678 permission_status_cb.Run(allowed); |
| 679 } | 679 } |
| 680 } | 680 } |
| 681 | 681 |
| 682 void BrowserCdmManager::CreateSessionAndGenerateRequestIfPermitted( | 682 void BrowserCdmManager::CreateSessionAndGenerateRequestIfPermitted( |
| 683 int render_frame_id, | 683 int render_frame_id, |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); | 722 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); |
| 723 if (!cdm) { | 723 if (!cdm) { |
| 724 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); | 724 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); |
| 725 return; | 725 return; |
| 726 } | 726 } |
| 727 | 727 |
| 728 cdm->LoadSession(session_type, session_id, std::move(promise)); | 728 cdm->LoadSession(session_type, session_id, std::move(promise)); |
| 729 } | 729 } |
| 730 | 730 |
| 731 } // namespace content | 731 } // namespace content |
| OLD | NEW |