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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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() { | 403 void Bus::GetManagedObjects() { |
404 for (ObjectManagerTable::iterator iter = object_manager_table_.begin(); | 404 for (ObjectManagerTable::iterator iter = object_manager_table_.begin(); |
405 iter != object_manager_table_.end(); ++iter) { | 405 iter != object_manager_table_.end(); ++iter) { |
406 iter->second->GetManagedObjects(); | 406 // Don't spam the logs with D-Bus errors if the service is unavailable. |
| 407 if (iter->second->ServiceIsAvailable()) |
| 408 iter->second->GetManagedObjects(); |
407 } | 409 } |
408 } | 410 } |
409 | 411 |
410 bool Bus::Connect() { | 412 bool Bus::Connect() { |
411 // dbus_bus_get_private() and dbus_bus_get() are blocking calls. | 413 // dbus_bus_get_private() and dbus_bus_get() are blocking calls. |
412 AssertOnDBusThread(); | 414 AssertOnDBusThread(); |
413 | 415 |
414 // Check if it's already initialized. | 416 // Check if it's already initialized. |
415 if (connection_) | 417 if (connection_) |
416 return true; | 418 return true; |
(...skipping 799 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1216 kNameOwnerChangedSignal)) { | 1218 kNameOwnerChangedSignal)) { |
1217 Bus* self = static_cast<Bus*>(data); | 1219 Bus* self = static_cast<Bus*>(data); |
1218 self->OnServiceOwnerChanged(message); | 1220 self->OnServiceOwnerChanged(message); |
1219 } | 1221 } |
1220 // Always return unhandled to let others, e.g. ObjectProxies, handle the same | 1222 // Always return unhandled to let others, e.g. ObjectProxies, handle the same |
1221 // signal. | 1223 // signal. |
1222 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 1224 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
1223 } | 1225 } |
1224 | 1226 |
1225 } // namespace dbus | 1227 } // namespace dbus |
OLD | NEW |