summaryrefslogtreecommitdiffstats
path: root/dbus/bus.h
diff options
context:
space:
mode:
authornona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 16:44:40 +0000
committernona@chromium.org <nona@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-02-15 16:44:40 +0000
commitea5451957df86623f9dd52ad2dd2c12c5ecd70a6 (patch)
tree8fa3aa300a73b7fd2372f40429ebdc87bcd198a1 /dbus/bus.h
parentce88a911017e862c1623c481e41e810330112647 (diff)
downloadchromium_src-ea5451957df86623f9dd52ad2dd2c12c5ecd70a6.zip
chromium_src-ea5451957df86623f9dd52ad2dd2c12c5ecd70a6.tar.gz
chromium_src-ea5451957df86623f9dd52ad2dd2c12c5ecd70a6.tar.bz2
Supporting callback for Disconnected signal.
If the connection with dbus-daemon is closed, callback function set with SetDisconnectedCallback will be called. BUG=None TEST=ran dbus_unittests Review URL: https://chromiumcodereview.appspot.com/12224139 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@182736 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'dbus/bus.h')
-rw-r--r--dbus/bus.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/dbus/bus.h b/dbus/bus.h
index 1bf07d9..87df7c3 100644
--- a/dbus/bus.h
+++ b/dbus/bus.h
@@ -190,6 +190,12 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// // Do something.
//
std::string address;
+
+ // If the connection with dbus-daemon is closed, |disconnected_callback|
+ // will be called on the origin thread. This is also called when the
+ // disonnection by ShutdownAndBlock. |disconnected_callback| can be null
+ // callback
+ base::Closure disconnected_callback;
};
// Creates a Bus object. The actual connection will be established when
@@ -329,6 +335,13 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
// BLOCKING CALL.
virtual bool Connect();
+ // Disconnects the bus from the dbus-daemon.
+ // Safe to call multiple times and no operation after the first call.
+ // Do not call for shared connection it will be released by libdbus.
+ //
+ // BLOCKING CALL.
+ virtual void ClosePrivateConnection();
+
// Requests the ownership of the service name given by |service_name|.
// See also RequestOwnershipAndBlock().
//
@@ -601,6 +614,7 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> {
int num_pending_timeouts_;
std::string address_;
+ base::Closure on_disconnected_closure_;
DISALLOW_COPY_AND_ASSIGN(Bus);
};