Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(444)

Side by Side Diff: content/browser/media/cdm/browser_cdm_manager.cc

Issue 1726323002: Have Permission{Manager,Service} use Origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 655 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 WebContents* web_contents = WebContents::FromRenderFrameHost(rfh); 666 WebContents* web_contents = WebContents::FromRenderFrameHost(rfh);
667 PermissionManager* permission_manager = 667 PermissionManager* permission_manager =
668 web_contents->GetBrowserContext()->GetPermissionManager(); 668 web_contents->GetBrowserContext()->GetPermissionManager();
669 if (!permission_manager) { 669 if (!permission_manager) {
670 permission_status_cb.Run(false); 670 permission_status_cb.Run(false);
671 return; 671 return;
672 } 672 }
673 673
674 mojom::PermissionStatus permission_status = 674 mojom::PermissionStatus permission_status =
675 permission_manager->GetPermissionStatus( 675 permission_manager->GetPermissionStatus(
676 PermissionType::PROTECTED_MEDIA_IDENTIFIER, security_origin, 676 PermissionType::PROTECTED_MEDIA_IDENTIFIER,
677 web_contents->GetLastCommittedURL().GetOrigin()); 677 url::Origin(security_origin),
678 url::Origin(web_contents->GetLastCommittedURL()));
678 679
679 bool allowed = (permission_status == mojom::PermissionStatus::GRANTED); 680 bool allowed = (permission_status == mojom::PermissionStatus::GRANTED);
680 if (!task_runner_->RunsTasksOnCurrentThread()) { 681 if (!task_runner_->RunsTasksOnCurrentThread()) {
681 task_runner_->PostTask(FROM_HERE, 682 task_runner_->PostTask(FROM_HERE,
682 base::Bind(permission_status_cb, allowed)); 683 base::Bind(permission_status_cb, allowed));
683 } else { 684 } else {
684 permission_status_cb.Run(allowed); 685 permission_status_cb.Run(allowed);
685 } 686 }
686 } 687 }
687 688
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id); 729 scoped_refptr<MediaKeys> cdm = GetCdm(render_frame_id, cdm_id);
729 if (!cdm) { 730 if (!cdm) {
730 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found."); 731 promise->reject(MediaKeys::INVALID_STATE_ERROR, 0, "CDM not found.");
731 return; 732 return;
732 } 733 }
733 734
734 cdm->LoadSession(session_type, session_id, std::move(promise)); 735 cdm->LoadSession(session_type, session_id, std::move(promise));
735 } 736 }
736 737
737 } // namespace content 738 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/browser/permissions/permission_service_context.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698