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 #ifndef DBUS_BUS_H_ | 5 #ifndef DBUS_BUS_H_ |
6 #define DBUS_BUS_H_ | 6 #define DBUS_BUS_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 void OnRemoveTimeout(DBusTimeout* raw_timeout); | 527 void OnRemoveTimeout(DBusTimeout* raw_timeout); |
528 | 528 |
529 // Called when the "enabled" status of |raw_timeout| is toggled. | 529 // Called when the "enabled" status of |raw_timeout| is toggled. |
530 void OnToggleTimeout(DBusTimeout* raw_timeout); | 530 void OnToggleTimeout(DBusTimeout* raw_timeout); |
531 | 531 |
532 // Called when the dispatch status (i.e. if any incoming data is | 532 // Called when the dispatch status (i.e. if any incoming data is |
533 // available) is changed. | 533 // available) is changed. |
534 void OnDispatchStatusChanged(DBusConnection* connection, | 534 void OnDispatchStatusChanged(DBusConnection* connection, |
535 DBusDispatchStatus status); | 535 DBusDispatchStatus status); |
536 | 536 |
| 537 // Called when the connection is diconnected. |
| 538 void OnConnectionDisconnected(DBusConnection* connection); |
| 539 |
537 // Callback helper functions. Redirects to the corresponding member function. | 540 // Callback helper functions. Redirects to the corresponding member function. |
538 static dbus_bool_t OnAddWatchThunk(DBusWatch* raw_watch, void* data); | 541 static dbus_bool_t OnAddWatchThunk(DBusWatch* raw_watch, void* data); |
539 static void OnRemoveWatchThunk(DBusWatch* raw_watch, void* data); | 542 static void OnRemoveWatchThunk(DBusWatch* raw_watch, void* data); |
540 static void OnToggleWatchThunk(DBusWatch* raw_watch, void* data); | 543 static void OnToggleWatchThunk(DBusWatch* raw_watch, void* data); |
541 static dbus_bool_t OnAddTimeoutThunk(DBusTimeout* raw_timeout, void* data); | 544 static dbus_bool_t OnAddTimeoutThunk(DBusTimeout* raw_timeout, void* data); |
542 static void OnRemoveTimeoutThunk(DBusTimeout* raw_timeout, void* data); | 545 static void OnRemoveTimeoutThunk(DBusTimeout* raw_timeout, void* data); |
543 static void OnToggleTimeoutThunk(DBusTimeout* raw_timeout, void* data); | 546 static void OnToggleTimeoutThunk(DBusTimeout* raw_timeout, void* data); |
544 static void OnDispatchStatusChangedThunk(DBusConnection* connection, | 547 static void OnDispatchStatusChangedThunk(DBusConnection* connection, |
545 DBusDispatchStatus status, | 548 DBusDispatchStatus status, |
546 void* data); | 549 void* data); |
| 550 |
| 551 // Calls OnConnectionDisconnected if the Diconnected signal is received. |
| 552 static DBusHandlerResult OnConnectionDisconnectedFilter( |
| 553 DBusConnection *connection, |
| 554 DBusMessage *message, |
| 555 void *user_data); |
| 556 |
547 const BusType bus_type_; | 557 const BusType bus_type_; |
548 const ConnectionType connection_type_; | 558 const ConnectionType connection_type_; |
549 scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_; | 559 scoped_refptr<base::MessageLoopProxy> dbus_thread_message_loop_proxy_; |
550 base::WaitableEvent on_shutdown_; | 560 base::WaitableEvent on_shutdown_; |
551 DBusConnection* connection_; | 561 DBusConnection* connection_; |
552 | 562 |
553 scoped_refptr<base::MessageLoopProxy> origin_message_loop_proxy_; | 563 scoped_refptr<base::MessageLoopProxy> origin_message_loop_proxy_; |
554 base::PlatformThreadId origin_thread_id_; | 564 base::PlatformThreadId origin_thread_id_; |
555 | 565 |
556 std::set<std::string> owned_service_names_; | 566 std::set<std::string> owned_service_names_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 int num_pending_timeouts_; | 598 int num_pending_timeouts_; |
589 | 599 |
590 std::string address_; | 600 std::string address_; |
591 | 601 |
592 DISALLOW_COPY_AND_ASSIGN(Bus); | 602 DISALLOW_COPY_AND_ASSIGN(Bus); |
593 }; | 603 }; |
594 | 604 |
595 } // namespace dbus | 605 } // namespace dbus |
596 | 606 |
597 #endif // DBUS_BUS_H_ | 607 #endif // DBUS_BUS_H_ |
OLD | NEW |