Index: chromeos/dbus/dbus.cc |
diff --git a/chromeos/dbus/dbus.cc b/chromeos/dbus/dbus.cc |
index 534883b9a6afb31ddd2eda049e6a76d4767e4654..cfac2ef43a2da9be64c2cfe8e1a4bb2de6b6363e 100644 |
--- a/chromeos/dbus/dbus.cc |
+++ b/chromeos/dbus/dbus.cc |
@@ -232,7 +232,29 @@ bool RegisterExclusiveService(const BusConnection& connection, |
return true; |
} |
- |
+void SendSignalWithNoArgumentsToSystemBus(const char* path, |
+ const char* interface_name, |
+ const char* signal_name) { |
+ CHECK(path); |
+ CHECK(interface_name); |
+ CHECK(signal_name); |
+ chromeos::dbus::Proxy proxy(chromeos::dbus::GetSystemBusConnection(), |
+ path, |
+ interface_name); |
+ DBusMessage* signal = ::dbus_message_new_signal( |
+ path, |
+ interface_name, |
+ signal_name); |
+ if (!signal) { |
+ LOG(ERROR) << "Failed to create a signal: " |
+ << "path: " << path << ", " |
+ << "interface_name: " << interface_name << ", " |
+ << "signal_name: " << signal_name; |
+ return; |
+ } |
+ ::dbus_g_proxy_send(proxy.gproxy(), signal, NULL); |
+ ::dbus_message_unref(signal); |
+} |
} // namespace dbus |
} // namespace chromeos |