| Index: dbus/bus.cc
|
| diff --git a/dbus/bus.cc b/dbus/bus.cc
|
| index 6bd404c96622bc67c0ddbd0254f33cfa86694fa2..e4e91d7b1310d588a513a26a5e6c146d33bde211 100644
|
| --- a/dbus/bus.cc
|
| +++ b/dbus/bus.cc
|
| @@ -211,6 +211,10 @@ Bus::~Bus() {
|
| // DCHECK_EQ(0, num_pending_timeouts_);
|
| }
|
|
|
| +void Bus::SetDisconnectedCallback(const OnDisconnectedCallback& callback) {
|
| + on_disconnected_callback_ = callback;
|
| +}
|
| +
|
| ObjectProxy* Bus::GetObjectProxy(const std::string& service_name,
|
| const ObjectPath& object_path) {
|
| return GetObjectProxyWithOptions(service_name, object_path,
|
| @@ -875,6 +879,9 @@ void Bus::OnConnectionDisconnected(DBusConnection* connection) {
|
| return;
|
| DCHECK(!dbus_connection_get_is_connected(connection));
|
|
|
| + if (!on_disconnected_callback_.is_null())
|
| + PostTaskToOriginThread(FROM_HERE, on_disconnected_callback_);
|
| +
|
| if (shutdown_completed_)
|
| return; // Do nothing if the shutdown is already completed.
|
|
|
|
|