Commit 366eaf1d authored by mostynb's avatar mostynb Committed by Commit bot

favor DCHECK_CURRENTLY_ON for better logs in content/browser

BUG=466848

Review URL: https://codereview.chromium.org/1031133003

Cr-Commit-Position: refs/heads/master@{#322280}
parent 150f086c
......@@ -32,7 +32,7 @@ int64 FrameTreeNode::next_frame_tree_node_id_ = 1;
// static
FrameTreeNode* FrameTreeNode::GloballyFindByID(int64 frame_tree_node_id) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
FrameTreeNodeIDMap* nodes = g_frame_tree_node_id_map.Pointer();
FrameTreeNodeIDMap::iterator it = nodes->find(frame_tree_node_id);
return it == nodes->end() ? nullptr : it->second;
......
......@@ -504,7 +504,7 @@ bool GpuProcessHost::Init() {
return false;
if (in_process_) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO));
DCHECK_CURRENTLY_ON(BrowserThread::IO);
DCHECK(g_gpu_main_thread_factory);
in_process_gpu_thread_.reset(
g_gpu_main_thread_factory(InProcessChildThreadParams(
......
......@@ -120,7 +120,7 @@ AuraWindowCaptureMachine::~AuraWindowCaptureMachine() {}
bool AuraWindowCaptureMachine::Start(
const scoped_refptr<ThreadSafeCaptureOracle>& oracle_proxy,
const media::VideoCaptureParams& params) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// The window might be destroyed between SetWindow() and Start().
if (!desktop_window_)
......@@ -157,7 +157,7 @@ bool AuraWindowCaptureMachine::Start(
}
void AuraWindowCaptureMachine::Stop(const base::Closure& callback) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
power_save_blocker_.reset();
// Stop observing compositor and window events.
......@@ -177,7 +177,7 @@ void AuraWindowCaptureMachine::Stop(const base::Closure& callback) {
}
void AuraWindowCaptureMachine::SetWindow(aura::Window* window) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!desktop_window_);
desktop_window_ = window;
......@@ -193,7 +193,7 @@ void AuraWindowCaptureMachine::SetWindow(aura::Window* window) {
}
void AuraWindowCaptureMachine::UpdateCaptureSize() {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (oracle_proxy_.get() && desktop_window_) {
ui::Layer* layer = desktop_window_->layer();
oracle_proxy_->UpdateCaptureSize(ui::ConvertSizeToPixel(
......@@ -203,7 +203,7 @@ void AuraWindowCaptureMachine::UpdateCaptureSize() {
}
void AuraWindowCaptureMachine::Capture(bool dirty) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
// Do not capture if the desktop window is already destroyed.
if (!desktop_window_)
......@@ -267,7 +267,7 @@ bool AuraWindowCaptureMachine::ProcessCopyOutputResponse(
base::TimeTicks start_time,
const ThreadSafeCaptureOracle::CaptureFrameCallback& capture_frame_cb,
scoped_ptr<cc::CopyOutputResult> result) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
if (result->IsEmpty() || result->size().IsEmpty() || !desktop_window_)
return false;
......@@ -421,7 +421,7 @@ void AuraWindowCaptureMachine::OnWindowBoundsChanged(
}
void AuraWindowCaptureMachine::OnWindowDestroyed(aura::Window* window) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
Stop(base::Bind(&base::DoNothing));
......
......@@ -514,7 +514,7 @@ void BrowserCdmManager::CheckPermissionStatusOnUIThread(
int render_frame_id,
const GURL& security_origin,
const base::Callback<void(bool)>& permission_status_cb) {
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
DCHECK_CURRENTLY_ON(BrowserThread::UI);
RenderFrameHost* rfh =
RenderFrameHost::FromID(render_process_id_, render_frame_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment