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

Unified Diff: chromeos/dbus/dbus.cc

Issue 2842019: Allowed to construct a dbus::BusConnection object with NULL g_connection (Closed) Base URL: ssh://git@gitrw.chromium.org//common.git
Patch Set: fixed Created 10 years, 6 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 f6e2d25d0b9bd9df9686236085556a8710b1068b..532325bcdfc904d529ee090f6927fa91d6a5df1e 100644
--- a/chromeos/dbus/dbus.cc
+++ b/chromeos/dbus/dbus.cc
@@ -65,13 +65,19 @@ BusConnection GetPrivateBusConnection(const char* address) {
::DBusConnection* raw_connection
= ::dbus_connection_open_private(address, &error);
if (!raw_connection) {
- // TODO(yusukes): We should return an error rather than just abort().
- LOG(FATAL) << "dbus_connection_open_private failed";
+ LOG(WARNING) << "dbus_connection_open_private failed: " << address;
+ return BusConnection(NULL);
}
if (!::dbus_bus_register(raw_connection, &error)) {
- LOG(ERROR) << "dbus_bus_register failed";
+ LOG(ERROR) << "dbus_bus_register failed: "
+ << (error.message ? error.message : "Unknown Error.");
::dbus_error_free(&error);
+ // TODO(yusukes): We don't call dbus_connection_close() nor g_object_unref()
+ // here for now since these calls might interfare with IBusBus connections
+ // in libcros and Chrome. See the comment in ~InputMethodStatusConnection()
+ // function in platform/cros/chromeos_input_method.cc for details.
+ return BusConnection(NULL);
}
::dbus_connection_setup_with_g_main(
« 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