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 <string> | 7 #include <string> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 permission_status_cb); | 507 permission_status_cb); |
508 } | 508 } |
509 } | 509 } |
510 | 510 |
511 // Note: This function runs on the UI thread, which may be different from | 511 // Note: This function runs on the UI thread, which may be different from |
512 // |task_runner_|. Be careful about thread safety! | 512 // |task_runner_|. Be careful about thread safety! |
513 void BrowserCdmManager::CheckPermissionStatusOnUIThread( | 513 void BrowserCdmManager::CheckPermissionStatusOnUIThread( |
514 int render_frame_id, | 514 int render_frame_id, |
515 const GURL& security_origin, | 515 const GURL& security_origin, |
516 const base::Callback<void(bool)>& permission_status_cb) { | 516 const base::Callback<void(bool)>& permission_status_cb) { |
517 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 517 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
518 | 518 |
519 RenderFrameHost* rfh = | 519 RenderFrameHost* rfh = |
520 RenderFrameHost::FromID(render_process_id_, render_frame_id); | 520 RenderFrameHost::FromID(render_process_id_, render_frame_id); |
521 WebContents* web_contents = WebContents::FromRenderFrameHost(rfh); | 521 WebContents* web_contents = WebContents::FromRenderFrameHost(rfh); |
522 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); | 522 GURL embedding_origin = web_contents->GetLastCommittedURL().GetOrigin(); |
523 | 523 |
524 PermissionStatus permission_status = | 524 PermissionStatus permission_status = |
525 GetContentClient()->browser()->GetPermissionStatus( | 525 GetContentClient()->browser()->GetPermissionStatus( |
526 content::PermissionType::PROTECTED_MEDIA_IDENTIFIER, | 526 content::PermissionType::PROTECTED_MEDIA_IDENTIFIER, |
527 web_contents->GetBrowserContext(), security_origin, embedding_origin); | 527 web_contents->GetBrowserContext(), security_origin, embedding_origin); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
573 } | 573 } |
574 | 574 |
575 // Only the temporary session type is supported in browser CDM path. | 575 // Only the temporary session type is supported in browser CDM path. |
576 // TODO(xhwang): Add SessionType support if needed. | 576 // TODO(xhwang): Add SessionType support if needed. |
577 cdm->CreateSessionAndGenerateRequest(media::MediaKeys::TEMPORARY_SESSION, | 577 cdm->CreateSessionAndGenerateRequest(media::MediaKeys::TEMPORARY_SESSION, |
578 init_data_type_string, &init_data[0], | 578 init_data_type_string, &init_data[0], |
579 init_data.size(), promise.Pass()); | 579 init_data.size(), promise.Pass()); |
580 } | 580 } |
581 | 581 |
582 } // namespace content | 582 } // namespace content |
OLD | NEW |