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

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: rebase 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
« no previous file with comments | « dbus/test_service.cc ('k') | device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ec96544d775387d66dc1750c5ccb59bb3187c6b0..ce52f9fbdd07f628912443d1ddecfb0042238a01 100644
--- a/device/battery/battery_status_manager_linux.cc
+++ b/device/battery/battery_status_manager_linux.cc
@@ -15,6 +15,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 "base/version.h"
@@ -315,7 +316,7 @@ class BatteryStatusManagerLinux::BatteryStatusNotificationThread
~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)));
@@ -464,9 +465,8 @@ class BatteryStatusManagerLinux::BatteryStatusNotificationThread
// 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;
}
@@ -569,7 +569,7 @@ bool BatteryStatusManagerLinux::StartListeningBatteryChange() {
if (!StartNotifierThreadIfNecessary())
return false;
- notifier_thread_->message_loop()->PostTask(
+ notifier_thread_->task_runner()->PostTask(
FROM_HERE, base::Bind(&BatteryStatusNotificationThread::StartListening,
base::Unretained(notifier_thread_.get())));
return true;
@@ -579,7 +579,7 @@ void BatteryStatusManagerLinux::StopListeningBatteryChange() {
if (!notifier_thread_)
return;
- notifier_thread_->message_loop()->PostTask(
+ notifier_thread_->task_runner()->PostTask(
FROM_HERE, base::Bind(&BatteryStatusNotificationThread::StopListening,
base::Unretained(notifier_thread_.get())));
}
« no previous file with comments | « dbus/test_service.cc ('k') | device/bluetooth/bluez/bluetooth_adapter_profile_bluez_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698