| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "dbus/bus.h" | 5 #include "dbus/bus.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 393 scoped_refptr<dbus::ObjectManager> object_manager, | 393 scoped_refptr<dbus::ObjectManager> object_manager, |
| 394 const base::Closure& callback) { | 394 const base::Closure& callback) { |
| 395 AssertOnOriginThread(); | 395 AssertOnOriginThread(); |
| 396 DCHECK(object_manager.get()); | 396 DCHECK(object_manager.get()); |
| 397 | 397 |
| 398 // Release the object manager and run the callback. | 398 // Release the object manager and run the callback. |
| 399 object_manager = NULL; | 399 object_manager = NULL; |
| 400 callback.Run(); | 400 callback.Run(); |
| 401 } | 401 } |
| 402 | 402 |
| 403 void Bus::GetManagedObjects() { | |
| 404 for (ObjectManagerTable::iterator iter = object_manager_table_.begin(); | |
| 405 iter != object_manager_table_.end(); ++iter) { | |
| 406 iter->second->GetManagedObjects(); | |
| 407 } | |
| 408 } | |
| 409 | |
| 410 bool Bus::Connect() { | 403 bool Bus::Connect() { |
| 411 // dbus_bus_get_private() and dbus_bus_get() are blocking calls. | 404 // dbus_bus_get_private() and dbus_bus_get() are blocking calls. |
| 412 AssertOnDBusThread(); | 405 AssertOnDBusThread(); |
| 413 | 406 |
| 414 // Check if it's already initialized. | 407 // Check if it's already initialized. |
| 415 if (connection_) | 408 if (connection_) |
| 416 return true; | 409 return true; |
| 417 | 410 |
| 418 ScopedDBusError error; | 411 ScopedDBusError error; |
| 419 if (bus_type_ == CUSTOM_ADDRESS) { | 412 if (bus_type_ == CUSTOM_ADDRESS) { |
| (...skipping 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1216 kNameOwnerChangedSignal)) { | 1209 kNameOwnerChangedSignal)) { |
| 1217 Bus* self = static_cast<Bus*>(data); | 1210 Bus* self = static_cast<Bus*>(data); |
| 1218 self->OnServiceOwnerChanged(message); | 1211 self->OnServiceOwnerChanged(message); |
| 1219 } | 1212 } |
| 1220 // Always return unhandled to let others, e.g. ObjectProxies, handle the same | 1213 // Always return unhandled to let others, e.g. ObjectProxies, handle the same |
| 1221 // signal. | 1214 // signal. |
| 1222 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 1215 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
| 1223 } | 1216 } |
| 1224 | 1217 |
| 1225 } // namespace dbus | 1218 } // namespace dbus |
| OLD | NEW |