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

Unified Diff: chromeos/dbus/dbus.cc

Issue 3922003: Add SendSignalWithNoArgumentsToSystemBus() to dbus.h (Closed) Base URL: http://git.chromium.org/git/common.git
Patch Set: fix the name Created 10 years, 2 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 | « chromeos/dbus/dbus.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chromeos/dbus/dbus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698