| Index: device/battery/battery_status_manager_linux.cc
|
| diff --git a/device/battery/battery_status_manager_linux.cc b/device/battery/battery_status_manager_linux.cc
|
| index f708b8c49f23227a474567b8ec9ad2d9d8d10581..d389afc4598c4a987382854777a4a43d34d5a7cb 100644
|
| --- a/device/battery/battery_status_manager_linux.cc
|
| +++ b/device/battery/battery_status_manager_linux.cc
|
| @@ -11,6 +11,7 @@
|
|
|
| #include "base/macros.h"
|
| #include "base/metrics/histogram.h"
|
| +#include "base/single_thread_task_runner.h"
|
| #include "base/threading/thread.h"
|
| #include "base/values.h"
|
| #include "dbus/bus.h"
|
| @@ -117,7 +118,7 @@ class BatteryStatusNotificationThread : public base::Thread {
|
| ~BatteryStatusNotificationThread() override {
|
| // Make sure to shutdown the dbus connection if it is still open in the very
|
| // end. It needs to happen on the BatteryStatusNotificationThread.
|
| - message_loop()->PostTask(
|
| + message_loop()->task_runner()->PostTask(
|
| FROM_HERE,
|
| base::Bind(&BatteryStatusNotificationThread::ShutdownDBusConnection,
|
| base::Unretained(this)));
|
| @@ -216,9 +217,8 @@ class BatteryStatusNotificationThread : public base::Thread {
|
|
|
| // Shutdown DBus connection later because there may be pending tasks on
|
| // this thread.
|
| - message_loop()->PostTask(FROM_HERE,
|
| - base::Bind(&dbus::Bus::ShutdownAndBlock,
|
| - system_bus_));
|
| + message_loop()->task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&dbus::Bus::ShutdownAndBlock, system_bus_));
|
| system_bus_ = NULL;
|
| battery_proxy_ = NULL;
|
| }
|
| @@ -281,10 +281,9 @@ class BatteryStatusManagerLinux : public BatteryStatusManager {
|
| if (!StartNotifierThreadIfNecessary())
|
| return false;
|
|
|
| - notifier_thread_->message_loop()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&BatteryStatusNotificationThread::StartListening,
|
| - base::Unretained(notifier_thread_.get())));
|
| + notifier_thread_->task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&BatteryStatusNotificationThread::StartListening,
|
| + base::Unretained(notifier_thread_.get())));
|
| return true;
|
| }
|
|
|
| @@ -292,10 +291,9 @@ class BatteryStatusManagerLinux : public BatteryStatusManager {
|
| if (!notifier_thread_)
|
| return;
|
|
|
| - notifier_thread_->message_loop()->PostTask(
|
| - FROM_HERE,
|
| - base::Bind(&BatteryStatusNotificationThread::StopListening,
|
| - base::Unretained(notifier_thread_.get())));
|
| + notifier_thread_->task_runner()->PostTask(
|
| + FROM_HERE, base::Bind(&BatteryStatusNotificationThread::StopListening,
|
| + base::Unretained(notifier_thread_.get())));
|
| }
|
|
|
| // Starts the notifier thread if not already started and returns true on
|
|
|