| 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> |
| 8 |
| 7 #include "base/bind.h" | 9 #include "base/bind.h" |
| 8 #include "base/logging.h" | 10 #include "base/logging.h" |
| 9 #include "base/message_loop/message_loop.h" | 11 #include "base/message_loop/message_loop.h" |
| 10 #include "base/stl_util.h" | 12 #include "base/stl_util.h" |
| 11 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 12 #include "base/threading/thread.h" | 14 #include "base/threading/thread.h" |
| 13 #include "base/threading/thread_restrictions.h" | 15 #include "base/threading/thread_restrictions.h" |
| 14 #include "base/time/time.h" | 16 #include "base/time/time.h" |
| 15 #include "dbus/exported_object.h" | 17 #include "dbus/exported_object.h" |
| 16 #include "dbus/message.h" | 18 #include "dbus/message.h" |
| (...skipping 654 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 671 DBusPendingCall** pending_call, | 673 DBusPendingCall** pending_call, |
| 672 int timeout_ms) { | 674 int timeout_ms) { |
| 673 DCHECK(connection_); | 675 DCHECK(connection_); |
| 674 AssertOnDBusThread(); | 676 AssertOnDBusThread(); |
| 675 | 677 |
| 676 const bool success = dbus_connection_send_with_reply( | 678 const bool success = dbus_connection_send_with_reply( |
| 677 connection_, request, pending_call, timeout_ms); | 679 connection_, request, pending_call, timeout_ms); |
| 678 CHECK(success) << "Unable to allocate memory"; | 680 CHECK(success) << "Unable to allocate memory"; |
| 679 } | 681 } |
| 680 | 682 |
| 681 void Bus::Send(DBusMessage* request, uint32* serial) { | 683 void Bus::Send(DBusMessage* request, uint32_t* serial) { |
| 682 DCHECK(connection_); | 684 DCHECK(connection_); |
| 683 AssertOnDBusThread(); | 685 AssertOnDBusThread(); |
| 684 | 686 |
| 685 const bool success = dbus_connection_send(connection_, request, serial); | 687 const bool success = dbus_connection_send(connection_, request, serial); |
| 686 CHECK(success) << "Unable to allocate memory"; | 688 CHECK(success) << "Unable to allocate memory"; |
| 687 } | 689 } |
| 688 | 690 |
| 689 void Bus::AddFilterFunction(DBusHandleMessageFunction filter_function, | 691 void Bus::AddFilterFunction(DBusHandleMessageFunction filter_function, |
| 690 void* user_data) { | 692 void* user_data) { |
| 691 DCHECK(connection_); | 693 DCHECK(connection_); |
| (...skipping 519 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1211 kNameOwnerChangedSignal)) { | 1213 kNameOwnerChangedSignal)) { |
| 1212 Bus* self = static_cast<Bus*>(data); | 1214 Bus* self = static_cast<Bus*>(data); |
| 1213 self->OnServiceOwnerChanged(message); | 1215 self->OnServiceOwnerChanged(message); |
| 1214 } | 1216 } |
| 1215 // Always return unhandled to let others, e.g. ObjectProxies, handle the same | 1217 // Always return unhandled to let others, e.g. ObjectProxies, handle the same |
| 1216 // signal. | 1218 // signal. |
| 1217 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 1219 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
| 1218 } | 1220 } |
| 1219 | 1221 |
| 1220 } // namespace dbus | 1222 } // namespace dbus |
| OLD | NEW |