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

Unified Diff: dbus/test_service.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/signal_sender_verification_unittest.cc ('k') | device/battery/battery_status_manager_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/test_service.cc
diff --git a/dbus/test_service.cc b/dbus/test_service.cc
index 4465c190d02f555bb835e7969f8d618032ef8d98..209b41dfe6229444229ed3b9120eff0707cb1605 100644
--- a/dbus/test_service.cc
+++ b/dbus/test_service.cc
@@ -12,6 +12,7 @@
#include "base/bind.h"
#include "base/guid.h"
#include "base/run_loop.h"
+#include "base/single_thread_task_runner.h"
#include "base/test/test_timeouts.h"
#include "base/threading/platform_thread.h"
#include "dbus/bus.h"
@@ -75,10 +76,9 @@ bool TestService::WaitUntilServiceIsStarted() {
}
void TestService::ShutdownAndBlock() {
- message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&TestService::ShutdownAndBlockInternal,
- base::Unretained(this)));
+ message_loop()->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&TestService::ShutdownAndBlockInternal,
+ base::Unretained(this)));
}
bool TestService::HasDBusThread() {
@@ -93,19 +93,15 @@ void TestService::ShutdownAndBlockInternal() {
}
void TestService::SendTestSignal(const std::string& message) {
- message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&TestService::SendTestSignalInternal,
- base::Unretained(this),
- message));
+ message_loop()->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&TestService::SendTestSignalInternal,
+ base::Unretained(this), message));
}
void TestService::SendTestSignalFromRoot(const std::string& message) {
- message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&TestService::SendTestSignalFromRootInternal,
- base::Unretained(this),
- message));
+ message_loop()->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&TestService::SendTestSignalFromRootInternal,
+ base::Unretained(this), message));
}
void TestService::SendTestSignalInternal(const std::string& message) {
@@ -132,11 +128,9 @@ void TestService::SendTestSignalFromRootInternal(const std::string& message) {
}
void TestService::RequestOwnership(base::Callback<void(bool)> callback) {
- message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&TestService::RequestOwnershipInternal,
- base::Unretained(this),
- callback));
+ message_loop()->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&TestService::RequestOwnershipInternal,
+ base::Unretained(this), callback));
}
void TestService::RequestOwnershipInternal(
@@ -330,12 +324,10 @@ void TestService::SlowEcho(MethodCall* method_call,
void TestService::AsyncEcho(MethodCall* method_call,
ExportedObject::ResponseSender response_sender) {
// Schedule a call to Echo() to send an asynchronous response after we return.
- message_loop()->PostDelayedTask(FROM_HERE,
- base::Bind(&TestService::Echo,
- base::Unretained(this),
- method_call,
- response_sender),
- TestTimeouts::tiny_timeout());
+ message_loop()->task_runner()->PostDelayedTask(
+ FROM_HERE, base::Bind(&TestService::Echo, base::Unretained(this),
+ method_call, response_sender),
+ TestTimeouts::tiny_timeout());
}
void TestService::BrokenMethod(MethodCall* method_call,
@@ -648,11 +640,9 @@ void TestService::AddPropertiesToWriter(MessageWriter* writer) {
}
void TestService::AddObject(const ObjectPath& object_path) {
- message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&TestService::AddObjectInternal,
- base::Unretained(this),
- object_path));
+ message_loop()->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&TestService::AddObjectInternal,
+ base::Unretained(this), object_path));
}
void TestService::AddObjectInternal(const ObjectPath& object_path) {
@@ -674,10 +664,9 @@ void TestService::AddObjectInternal(const ObjectPath& object_path) {
}
void TestService::RemoveObject(const ObjectPath& object_path) {
- message_loop()->PostTask(FROM_HERE,
- base::Bind(&TestService::RemoveObjectInternal,
- base::Unretained(this),
- object_path));
+ message_loop()->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&TestService::RemoveObjectInternal,
+ base::Unretained(this), object_path));
}
void TestService::RemoveObjectInternal(const ObjectPath& object_path) {
@@ -694,11 +683,9 @@ void TestService::RemoveObjectInternal(const ObjectPath& object_path) {
}
void TestService::SendPropertyChangedSignal(const std::string& name) {
- message_loop()->PostTask(
- FROM_HERE,
- base::Bind(&TestService::SendPropertyChangedSignalInternal,
- base::Unretained(this),
- name));
+ message_loop()->task_runner()->PostTask(
+ FROM_HERE, base::Bind(&TestService::SendPropertyChangedSignalInternal,
+ base::Unretained(this), name));
}
void TestService::SendPropertyChangedSignalInternal(const std::string& name) {
@@ -725,7 +712,7 @@ void TestService::SendPropertyChangedSignalInternal(const std::string& name) {
}
void TestService::SendPropertyInvalidatedSignal() {
- message_loop()->PostTask(
+ message_loop()->task_runner()->PostTask(
FROM_HERE, base::Bind(&TestService::SendPropertyInvalidatedSignalInternal,
base::Unretained(this)));
}
« no previous file with comments | « dbus/signal_sender_verification_unittest.cc ('k') | device/battery/battery_status_manager_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698