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

Unified Diff: dbus/bus.cc

Issue 11312036: Call dbus_bus_register at the beginning of connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/bus.cc
diff --git a/dbus/bus.cc b/dbus/bus.cc
index 988a7c1f9c0ac60fd25b7d9e7db67f5c3803f397..30b6cc31cfa8f15a888deba5fd993c1175dfc045 100644
--- a/dbus/bus.cc
+++ b/dbus/bus.cc
@@ -308,6 +308,19 @@ bool Bus::Connect() {
<< (error.is_set() ? error.message() : "");
return false;
}
+
+ if (bus_type_ == CUSTOM_ADDRESS) {
+ // We should call dbus_bus_register here, otherwise unique name can not be
+ // acquired. According to dbus specification, it is responsible to call
+ // org.freedesktop.DBus.Hello method at the beging of bus connection to
+ // acquire unique name. In the case of dbus_bus_get, dbus_bus_register is
+ // called internally.
+ if (!dbus_bus_register(connection_, error.get())) {
+ LOG(ERROR) << "Failed to register the bus component: "
+ << (error.is_set() ? error.message() : "");
+ return false;
+ }
+ }
// We shouldn't exit on the disconnected signal.
dbus_connection_set_exit_on_disconnect(connection_, false);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698