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

Unified Diff: dbus/test_service.cc

Issue 7845029: Stop restricting the sender object path for incoming signals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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.h ('k') | no next file » | 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 bc4ec86d164f57380e74e567155c9ce4c80e9f6e..ca0eea3fa12f45e4d81a4ba02eaf747fa29b2218 100644
--- a/dbus/test_service.cc
+++ b/dbus/test_service.cc
@@ -72,6 +72,14 @@ void TestService::SendTestSignal(const std::string& message) {
message));
}
+void TestService::SendTestSignalFromRoot(const std::string& message) {
+ message_loop()->PostTask(
+ FROM_HERE,
+ base::Bind(&TestService::SendTestSignalFromRootInternal,
+ base::Unretained(this),
+ message));
+}
+
void TestService::SendTestSignalInternal(const std::string& message) {
dbus::Signal signal("org.chromium.TestInterface", "Test");
dbus::MessageWriter writer(&signal);
@@ -79,6 +87,18 @@ void TestService::SendTestSignalInternal(const std::string& message) {
exported_object_->SendSignal(&signal);
}
+void TestService::SendTestSignalFromRootInternal(const std::string& message) {
+ dbus::Signal signal("org.chromium.TestInterface", "Test");
+ dbus::MessageWriter writer(&signal);
+ writer.AppendString(message);
+
+ // Use "/" just like dbus-send does.
+ ExportedObject* root_object =
+ bus_->GetExportedObject("org.chromium.TestService",
+ "/");
+ root_object->SendSignal(&signal);
+}
+
void TestService::OnExported(const std::string& interface_name,
const std::string& method_name,
bool success) {
« no previous file with comments | « dbus/test_service.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698