From 5d9ba8b821e1af8b84cd6ff8714b0456f2183d99 Mon Sep 17 00:00:00 2001 From: Jeremy Apthorp Date: Fri, 14 Sep 2018 17:19:19 -0700 Subject: [PATCH] MessageLoopCurrent --- atom/browser/bridge_task_runner.cc | 8 ++++---- chromium_src/chrome/browser/printing/print_job.cc | 6 +----- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/atom/browser/bridge_task_runner.cc b/atom/browser/bridge_task_runner.cc index a80002c0698b..b62a5bdb83d5 100644 --- a/atom/browser/bridge_task_runner.cc +++ b/atom/browser/bridge_task_runner.cc @@ -14,7 +14,7 @@ BridgeTaskRunner::BridgeTaskRunner() = default; BridgeTaskRunner::~BridgeTaskRunner() = default; void BridgeTaskRunner::MessageLoopIsReady() { - auto* message_loop = base::MessageLoop::current(); + auto message_loop = base::MessageLoop::current(); CHECK(message_loop); for (TaskPair& task : tasks_) { message_loop->task_runner()->PostDelayedTask( @@ -29,7 +29,7 @@ void BridgeTaskRunner::MessageLoopIsReady() { bool BridgeTaskRunner::PostDelayedTask(const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { - auto* message_loop = base::MessageLoop::current(); + auto message_loop = base::MessageLoop::current(); if (!message_loop) { tasks_.push_back(std::make_tuple(from_here, std::move(task), delay)); return true; @@ -40,7 +40,7 @@ bool BridgeTaskRunner::PostDelayedTask(const base::Location& from_here, } bool BridgeTaskRunner::RunsTasksInCurrentSequence() const { - auto* message_loop = base::MessageLoop::current(); + auto message_loop = base::MessageLoop::current(); if (!message_loop) return true; @@ -51,7 +51,7 @@ bool BridgeTaskRunner::PostNonNestableDelayedTask( const base::Location& from_here, base::OnceClosure task, base::TimeDelta delay) { - auto* message_loop = base::MessageLoop::current(); + auto message_loop = base::MessageLoop::current(); if (!message_loop) { non_nestable_tasks_.push_back( std::make_tuple(from_here, std::move(task), delay)); diff --git a/chromium_src/chrome/browser/printing/print_job.cc b/chromium_src/chrome/browser/printing/print_job.cc index 1957330cfd8a..638ac541bb3f 100644 --- a/chromium_src/chrome/browser/printing/print_job.cc +++ b/chromium_src/chrome/browser/printing/print_job.cc @@ -44,11 +44,7 @@ void HoldRefCallback(const scoped_refptr& owner, PrintJob::PrintJob() : is_job_pending_(false), is_canceling_(false), quit_factory_(this) { - // This is normally a UI message loop, but in unit tests, the message loop is - // of the 'default' type. - DCHECK(base::MessageLoopForUI::IsCurrent() || - base::MessageLoop::current()->type() == - base::MessageLoop::TYPE_DEFAULT); + DCHECK(base::MessageLoopForUI::IsCurrent()); } PrintJob::~PrintJob() {