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

Unified Diff: dbus/object_proxy.h

Issue 11199007: Add sender verification of D-Bus signals. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: restore synchronous UpdateNameOwner and use it only in ConnectToSignalInternal Created 8 years, 2 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/dbus.gyp ('k') | dbus/object_proxy.cc » ('j') | dbus/object_proxy.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dbus/object_proxy.h
diff --git a/dbus/object_proxy.h b/dbus/object_proxy.h
index 9642262be56e909cf099211108e6bae54cc3f09c..df6001479bfd72221c7e72425c8f552547512683 100644
--- a/dbus/object_proxy.h
+++ b/dbus/object_proxy.h
@@ -236,6 +236,22 @@ class ObjectProxy : public base::RefCountedThreadSafe<ObjectProxy> {
ResponseCallback response_callback,
ErrorResponse* error_response);
+ // Adds the match rule to the bus and associate the callback with the signal.
+ bool AddMatchRuleWithCallback(const std::string& match_rule,
+ const std::string& absolute_signal_name,
+ SignalCallback signal_callback);
+
+ // Adds the match rule to the bus so that HandleMessage can see the signal.
+ bool AddMatchRuleWithoutCallback(const std::string& match_rule,
+ const std::string& absolute_signal_name);
+
+ // Calls D-Bus's GetNameOwner method synchronously to update
+ // |service_name_owner_| with the current owner of |service_name_|.
satorux1 2012/10/26 05:26:00 Please add // // BLOCKING CALL.
Haruki Sato 2012/10/26 05:53:13 Done. Thanks.
+ bool UpdateNameOwner();
satorux1 2012/10/26 05:26:00 UpdateNameOwnerAndBlock()
Haruki Sato 2012/10/26 05:53:13 Done.
+
+ // Handles NameOwnerChanged signal from D-Bus's special message bus.
+ DBusHandlerResult HandleNameOwnerChanged(dbus::Signal* signal);
+
scoped_refptr<Bus> bus_;
std::string service_name_;
ObjectPath object_path_;
@@ -252,6 +268,9 @@ class ObjectProxy : public base::RefCountedThreadSafe<ObjectProxy> {
const bool ignore_service_unknown_errors_;
+ // Known name owner of the well-known bus name represnted by |service_name_|.
+ std::string service_name_owner_;
+
DISALLOW_COPY_AND_ASSIGN(ObjectProxy);
};
« no previous file with comments | « dbus/dbus.gyp ('k') | dbus/object_proxy.cc » ('j') | dbus/object_proxy.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698