Chromium Code Reviews| Index: dbus/bus.h |
| diff --git a/dbus/bus.h b/dbus/bus.h |
| index 1bf07d9e05384ac3c57216cedc0ac73698f5c5cc..0e21e51b23a91ab9408b6c8e481e7f8d324d810a 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 original thread. This is also called when the |
|
satorux1
2013/02/15 03:55:20
original -> origin
Seigo Nonaka
2013/02/15 04:18:36
Done.
|
| + // 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. |
| + // 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); |
| }; |