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

Unified Diff: dbus/object_proxy.cc

Issue 7845029: Stop restricting the sender object path for incoming signals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 3 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 | « dbus/end_to_end_async_unittest.cc ('k') | dbus/test_service.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/object_proxy.cc
diff --git a/dbus/object_proxy.cc b/dbus/object_proxy.cc
index faeee0e548396b443bc1cfdf0a113b4c9273a2db..863bef5aa4a1291aab3aa96b2ae02995c935f123 100644
--- a/dbus/object_proxy.cc
+++ b/dbus/object_proxy.cc
@@ -291,10 +291,14 @@ void ObjectProxy::ConnectToSignalInternal(
filter_added_ = true;
}
// Add a match rule so the signal goes through HandleMessage().
+ //
+ // We don't restrict the sender object path to be |object_path_| here,
+ // to make it easy to test D-Bus signal handling with dbus-send, that
+ // uses "/" as the sender object path. We can make the object path
+ // restriction customizable when it becomes necessary.
const std::string match_rule =
- base::StringPrintf("type='signal', interface='%s', path='%s'",
- interface_name.c_str(),
- object_path_.c_str());
+ base::StringPrintf("type='signal', interface='%s'",
+ interface_name.c_str());
ScopedDBusError error;
bus_->AddMatch(match_rule, error.get());;
if (error.is_set()) {
@@ -341,9 +345,7 @@ DBusHandlerResult ObjectProxy::HandleMessage(
scoped_ptr<Signal> signal(
Signal::FromRawMessage(raw_message));
- // The signal is not coming from the remote object we are attaching to.
- if (signal->GetPath() != object_path_)
- return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
+ VLOG(1) << "Signal received: " << signal->ToString();
const std::string interface = signal->GetInterface();
const std::string member = signal->GetMember();
« no previous file with comments | « dbus/end_to_end_async_unittest.cc ('k') | dbus/test_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698