Skip to content

Commit

Permalink
dbus: Suppress NameHasNoOwner errors when connecting to signals
Browse files Browse the repository at this point in the history
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
  • Loading branch information
satorux@chromium.org committed Aug 16, 2013
1 parent edfca70 commit d491b73
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dbus/object_proxy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit d491b73

Please sign in to comment.