0

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
This commit is contained in:
satorux@chromium.org
2013-08-16 09:16:42 +00:00
parent edfca70c96
commit d491b73444

@ -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(