| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // TODO(satorux): | 5 // TODO(satorux): |
| 6 // - Handle "disconnected" signal. | 6 // - Handle "disconnected" signal. |
| 7 | 7 |
| 8 #include "dbus/bus.h" | 8 #include "dbus/bus.h" |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 383 ProcessAllIncomingDataIfAny(); | 383 ProcessAllIncomingDataIfAny(); |
| 384 | 384 |
| 385 bool success = dbus_connection_set_watch_functions(connection_, | 385 bool success = dbus_connection_set_watch_functions(connection_, |
| 386 &Bus::OnAddWatchThunk, | 386 &Bus::OnAddWatchThunk, |
| 387 &Bus::OnRemoveWatchThunk, | 387 &Bus::OnRemoveWatchThunk, |
| 388 &Bus::OnToggleWatchThunk, | 388 &Bus::OnToggleWatchThunk, |
| 389 this, | 389 this, |
| 390 NULL); | 390 NULL); |
| 391 CHECK(success) << "Unable to allocate memory"; | 391 CHECK(success) << "Unable to allocate memory"; |
| 392 | 392 |
| 393 // TODO(satorux): Timeout is not yet implemented. | |
| 394 success = dbus_connection_set_timeout_functions(connection_, | 393 success = dbus_connection_set_timeout_functions(connection_, |
| 395 &Bus::OnAddTimeoutThunk, | 394 &Bus::OnAddTimeoutThunk, |
| 396 &Bus::OnRemoveTimeoutThunk, | 395 &Bus::OnRemoveTimeoutThunk, |
| 397 &Bus::OnToggleTimeoutThunk, | 396 &Bus::OnToggleTimeoutThunk, |
| 398 this, | 397 this, |
| 399 NULL); | 398 NULL); |
| 400 CHECK(success) << "Unable to allocate memory"; | 399 CHECK(success) << "Unable to allocate memory"; |
| 401 | 400 |
| 402 dbus_connection_set_dispatch_status_function( | 401 dbus_connection_set_dispatch_status_function( |
| 403 connection_, | 402 connection_, |
| (...skipping 336 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 740 } | 739 } |
| 741 | 740 |
| 742 void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection, | 741 void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection, |
| 743 DBusDispatchStatus status, | 742 DBusDispatchStatus status, |
| 744 void* data) { | 743 void* data) { |
| 745 Bus* self = static_cast<Bus*>(data); | 744 Bus* self = static_cast<Bus*>(data); |
| 746 return self->OnDispatchStatusChanged(connection, status); | 745 return self->OnDispatchStatusChanged(connection, status); |
| 747 } | 746 } |
| 748 | 747 |
| 749 } // namespace dbus | 748 } // namespace dbus |
| OLD | NEW |