diff options
Diffstat (limited to 'dbus/bus.cc')
-rw-r--r-- | dbus/bus.cc | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/dbus/bus.cc b/dbus/bus.cc index 0d170ff..fafacd3 100644 --- a/dbus/bus.cc +++ b/dbus/bus.cc @@ -775,6 +775,24 @@ void Bus::ProcessAllIncomingDataIfAny() { } } +void Bus::PostTaskToDBusThreadAndReply( + const tracked_objects::Location& from_here, + const base::Closure& task, + const base::Closure& reply) { + AssertOnOriginThread(); + + if (dbus_task_runner_.get()) { + if (!dbus_task_runner_->PostTaskAndReply(from_here, task, reply)) { + LOG(WARNING) << "Failed to post a task to the D-Bus thread message loop"; + } + } else { + DCHECK(origin_task_runner_.get()); + if (!origin_task_runner_->PostTaskAndReply(from_here, task, reply)) { + LOG(WARNING) << "Failed to post a task to the origin message loop"; + } + } +} + void Bus::PostTaskToOriginThread(const tracked_objects::Location& from_here, const base::Closure& task) { DCHECK(origin_task_runner_.get()); |