Index: dbus/bus.h |
diff --git a/dbus/bus.h b/dbus/bus.h |
index 1bf07d9e05384ac3c57216cedc0ac73698f5c5cc..4555018efad722dfe50544bd1721571355e506c8 100644 |
--- a/dbus/bus.h |
+++ b/dbus/bus.h |
@@ -201,6 +201,12 @@ class CHROME_DBUS_EXPORT Bus : public base::RefCountedThreadSafe<Bus> { |
// - the requested service name. |
// - whether ownership has been obtained or not. |
typedef base::Callback<void (const std::string&, bool)> OnOwnershipCallback; |
+ |
+ // Registers a callback function which is called when the connection with |
+ // dbus-daemon is closed. This is also called when the connection is closed |
+ // by ShutdownAndBlock. |closure| can be null callback. |
+ void SetDisconnectedCallback(const base::Closure& closure); |
satorux1
2013/02/14 02:30:41
What about adding the closure parameter to CloseCo
Seigo Nonaka
2013/02/14 03:33:52
I think your suggestion doesn't help my original m
|
+ |
// TODO(satorux): Remove the service name parameter as the caller of |
// RequestOwnership() knows the service name. |
@@ -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. |
+ // No operation if the bus type is not a private bus or the bus is already |
+ // disconnected. |
+ // |
+ // BLOCKING CALL. |
+ virtual void CloseConnection(); |
+ |
// 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); |
}; |