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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chromeos/dbus/dbus.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chromeos/dbus/dbus.h" 5 #include "chromeos/dbus/dbus.h"
6 6
7 #include <dbus/dbus.h> 7 #include <dbus/dbus.h>
8 #include <dbus/dbus-glib-bindings.h> 8 #include <dbus/dbus-glib-bindings.h>
9 #include <dbus/dbus-glib-lowlevel.h> 9 #include <dbus/dbus-glib-lowlevel.h>
10 #include <base/logging.h> 10 #include <base/logging.h>
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after
225 return false; 225 return false;
226 } 226 }
227 227
228 // Determine a path from the service name and register the object. 228 // Determine a path from the service name and register the object.
229 dbus_g_connection_register_g_object(connection.g_connection(), 229 dbus_g_connection_register_g_object(connection.g_connection(),
230 service_path, 230 service_path,
231 object); 231 object);
232 return true; 232 return true;
233 } 233 }
234 234
235 235 void SendSignalWithNoArgumentsToSystemBus(const char* path,
236 const char* interface_name,
237 const char* signal_name) {
238 CHECK(path);
239 CHECK(interface_name);
240 CHECK(signal_name);
241 chromeos::dbus::Proxy proxy(chromeos::dbus::GetSystemBusConnection(),
242 path,
243 interface_name);
244 DBusMessage* signal = ::dbus_message_new_signal(
245 path,
246 interface_name,
247 signal_name);
248 if (!signal) {
249 LOG(ERROR) << "Failed to create a signal: "
250 << "path: " << path << ", "
251 << "interface_name: " << interface_name << ", "
252 << "signal_name: " << signal_name;
253 return;
254 }
255 ::dbus_g_proxy_send(proxy.gproxy(), signal, NULL);
256 ::dbus_message_unref(signal);
257 }
236 258
237 } // namespace dbus 259 } // namespace dbus
238 } // namespace chromeos 260 } // namespace chromeos
OLDNEW
« 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