Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2884)

Unified Diff: device/battery/battery_status_manager_linux.cc

Issue 2211473003: Remove calls to deprecated MessageLoop methods on Windows and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: CR Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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

Powered by Google App Engine
This is Rietveld 408576698