mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
MessageLoopCurrent
This commit is contained in:
committed by
Aleksei Kuzmin
parent
08265ba3e2
commit
5d9ba8b821
@@ -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));
|
||||
|
||||
@@ -44,11 +44,7 @@ void HoldRefCallback(const scoped_refptr<PrintJobWorkerOwner>& 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() {
|
||||
|
||||
Reference in New Issue
Block a user