summaryrefslogtreecommitdiffstats
path: root/dbus/exported_object.h
diff options
context:
space:
mode:
authorsatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 07:29:21 +0000
committersatorux@chromium.org <satorux@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-08-23 07:29:21 +0000
commit3beaaa4e9b8c41be94e1688a075357b5ae58a280 (patch)
tree1c7b6d7abc4a6d54346334c132ceb5f71869661c /dbus/exported_object.h
parent852754acf9190bd253e8c2e9b45d2b761cf7a12a (diff)
downloadchromium_src-3beaaa4e9b8c41be94e1688a075357b5ae58a280.zip
chromium_src-3beaaa4e9b8c41be94e1688a075357b5ae58a280.tar.gz
chromium_src-3beaaa4e9b8c41be94e1688a075357b5ae58a280.tar.bz2
Add support for sending and receiving D-Bus signals.
ObjectProxy is used to receive signals from the remote object. ExportedObject is used to send signals from the exported object. Note that signals are asynchronos so we don't have a test in end_to_end_sync_unittest.cc BUG=90036 TEST=run unit tests Review URL: http://codereview.chromium.org/7655033 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@97831 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/exported_object.h')
-rw-r--r--dbus/exported_object.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/dbus/exported_object.h b/dbus/exported_object.h
index 1d35c11..1351824 100644
--- a/dbus/exported_object.h
+++ b/dbus/exported_object.h
@@ -24,6 +24,7 @@ namespace dbus {
class Bus;
class MethodCall;
class Response;
+class Signal;
// ExportedObject is used to export objects and methods to other D-Bus
// clients.
@@ -55,8 +56,8 @@ class ExportedObject : public base::RefCountedThreadSafe<ExportedObject> {
//
// |method_call_callback| will be called in the origin thread, when the
// exported method is called. As it's called in the origin thread,
- // callback| can safely reference objects in the origin thread (i.e. UI
- // thread in most cases).
+ // |method_callback| can safely reference objects in the origin thread
+ // (i.e. UI thread in most cases).
//
// BLOCKING CALL.
virtual bool ExportMethodAndBlock(const std::string& interface_name,
@@ -75,6 +76,10 @@ class ExportedObject : public base::RefCountedThreadSafe<ExportedObject> {
MethodCallCallback method_call_callback,
OnExportedCallback on_exported_callback);
+ // Requests to send the signal from this object. The signal will be sent
+ // asynchronously from the message loop in the D-Bus thread.
+ virtual void SendSignal(Signal* signal);
+
// Unregisters the object from the bus. The Bus object will take care of
// unregistering so you don't have to do this manually.
//
@@ -97,6 +102,9 @@ class ExportedObject : public base::RefCountedThreadSafe<ExportedObject> {
const std::string& method_name,
bool success);
+ // Helper function for SendSignal().
+ void SendSignalInternal(void* signal_message);
+
// Registers this object to the bus.
// Returns true on success, or the object is already registered.
//