Commit a3f28622 authored by Sonny Sasaka's avatar Sonny Sasaka Committed by Commit Bot

dbus: Don't DCHECK unexpected message type, but ignore it

In dbus::ExportedObject, an assumption was made that no signal could be
received for an exported object, so DCHECK was put there. Now that there
is a use case of D-Bus forwarding by Bluetooth dispatcher, it is fine
that an exported object receives D-Bus signal messages as it is a
property change signal that is handled by dbus::ObjectManager. So we can
just ignore message types other than method in dbus::ExportedObject
rather than DCHECK it.

BUG=835457

Change-Id: Icae03881052b3d7365a9017e5f2b987a058cd356
Reviewed-on: https://chromium-review.googlesource.com/1027081Reviewed-by: default avatarRyo Hashimoto <hashimoto@chromium.org>
Reviewed-by: default avatarSatoru Takabayashi <satorux@google.com>
Commit-Queue: Sonny Sasaka <sonnysasaka@chromium.org>
Cr-Commit-Position: refs/heads/master@{#553639}
parent cecb363d
......@@ -191,7 +191,10 @@ DBusHandlerResult ExportedObject::HandleMessage(
DBusConnection* connection,
DBusMessage* raw_message) {
bus_->AssertOnDBusThread();
DCHECK_EQ(DBUS_MESSAGE_TYPE_METHOD_CALL, dbus_message_get_type(raw_message));
// ExportedObject only handles method calls. Ignore other message types (e.g.
// signal).
if (dbus_message_get_type(raw_message) != DBUS_MESSAGE_TYPE_METHOD_CALL)
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
// raw_message will be unrefed on exit of the function. Increment the
// reference so we can use it in MethodCall.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment