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

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

Issue 1031133003: favor DCHECK_CURRENTLY_ON for better logs in content/browser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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
« no previous file with comments | « content/browser/media/capture/aura_window_capture_machine.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <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
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
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
OLDNEW
« no previous file with comments | « content/browser/media/capture/aura_window_capture_machine.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698