From d491b7344458aeab36d76a8f5207e9a4182d1344 Mon Sep 17 00:00:00 2001 From: "satorux@chromium.org" Date: Fri, 16 Aug 2013 09:16:42 +0000 Subject: [PATCH] dbus: Suppress NameHasNoOwner errors when connecting to signals The NameHasNoOwner errors are emitted as Chrome tries to get the identity of the service when connecting to signals for sender verification (crbug.com/140938), but the service may not yet be running, which is all right, hence the NameHasNoOwner errors here should be just supressed. BUG=273829 TEST=out/Debug/dbus_unittests --gtest_filter=SignalSenderVerificationTest.TestSignalAccepted; confirm that NameHasNoOwner is no longre emitted. Previously, an error message like below was emited: [12721:12722:0816/144031:3991948732792:ERROR:bus.cc(892)] Failed to get name owner. Got org.freedesktop.DBus.Error.NameHasNoOwner: Could not get owner of name 'org.chromium.TestService': no such name Review URL: https://chromiumcodereview.appspot.com/23143004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@217980 0039d316-1c4b-4281-b951-d872f2087c98 --- dbus/object_proxy.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/dbus/object_proxy.cc b/dbus/object_proxy.cc index 95aab8956d43ff..ea76fd72f091f9 100644 --- a/dbus/object_proxy.cc +++ b/dbus/object_proxy.cc @@ -612,8 +612,12 @@ bool ObjectProxy::AddMatchRuleWithoutCallback( void ObjectProxy::UpdateNameOwnerAndBlock() { bus_->AssertOnDBusThread(); + // Errors should be suppressed here, as the service may not be yet running + // when connecting to signals of the service, which is just fine. + // The ObjectProxy will be notified when the service is launched via + // NameOwnerChanged signal. See also comments in ConnectToSignalInternal(). service_name_owner_ = - bus_->GetServiceOwnerAndBlock(service_name_, Bus::REPORT_ERRORS); + bus_->GetServiceOwnerAndBlock(service_name_, Bus::SUPPRESS_ERRORS); } DBusHandlerResult ObjectProxy::HandleNameOwnerChanged(