Lines Matching defs:Bus
5 #include "dbus/bus.h"
41 // The class is used for watching the file descriptor used for D-Bus
102 // The class is used for monitoring the timeout used for D-Bus method
108 // Bus::OnRemoveTimeout(). That's why we don't simply delete the object in
109 // Bus::OnRemoveTimeout().
126 void StartMonitoring(Bus* bus) {
127 bus->PostDelayedTaskToDBusThread(FROM_HERE,
163 // occur if this function is called after Bus::OnRemoveTimeout().
181 Bus::Options::Options()
186 Bus::Options::~Options() {
189 Bus::Bus(const Options& options)
210 Bus::~Bus() {
223 ObjectProxy* Bus::GetObjectProxy(const std::string& service_name,
229 ObjectProxy* Bus::GetObjectProxyWithOptions(const std::string& service_name,
249 bool Bus::RemoveObjectProxy(const std::string& service_name,
257 bool Bus::RemoveObjectProxyWithOptions(const std::string& service_name,
270 &Bus::RemoveObjectProxyInternal,
279 void Bus::RemoveObjectProxyInternal(scoped_refptr<ObjectProxy> object_proxy,
288 ExportedObject* Bus::GetExportedObject(const ObjectPath& object_path) {
304 void Bus::UnregisterExportedObject(const ObjectPath& object_path) {
316 // Post the task to perform the final unregistration to the D-Bus thread.
317 // Since the registration also happens on the D-Bus thread in
322 base::Bind(&Bus::UnregisterExportedObjectInternal,
326 void Bus::UnregisterExportedObjectInternal(
333 ObjectManager* Bus::GetObjectManager(const std::string& service_name,
351 void Bus::RemoveObjectManager(const std::string& service_name,
364 void Bus::GetManagedObjects() {
371 bool Bus::Connect() {
395 LOG(ERROR) << "Failed to connect to the bus: "
403 // org.freedesktop.DBus.Hello method at the beging of bus connection to
407 LOG(ERROR) << "Failed to register the bus component: "
416 AddFilterFunction(Bus::OnConnectionDisconnectedFilter, this);
422 void Bus::ClosePrivateConnection() {
430 void Bus::ShutdownAndBlock() {
471 RemoveFilterFunction(Bus::OnConnectionDisconnectedFilter, this);
484 void Bus::ShutdownOnDBusThreadAndBlock() {
489 &Bus::ShutdownOnDBusThreadAndBlockInternal,
495 // Wait until the shutdown is complete on the D-Bus thread.
500 LOG_IF(ERROR, !signaled) << "Failed to shutdown the bus";
503 void Bus::RequestOwnership(const std::string& service_name,
509 &Bus::RequestOwnershipInternal,
513 void Bus::RequestOwnershipInternal(const std::string& service_name,
528 bool Bus::RequestOwnershipAndBlock(const std::string& service_name,
553 bool Bus::ReleaseOwnership(const std::string& service_name) {
562 LOG(ERROR) << service_name << " is not owned by the bus";
580 bool Bus::SetUpAsyncOperations() {
592 &Bus::OnAddWatchThunk,
593 &Bus::OnRemoveWatchThunk,
594 &Bus::OnToggleWatchThunk,
600 &Bus::OnAddTimeoutThunk,
601 &Bus::OnRemoveTimeoutThunk,
602 &Bus::OnToggleTimeoutThunk,
609 &Bus::OnDispatchStatusChangedThunk,
618 DBusMessage* Bus::SendWithReplyAndBlock(DBusMessage* request,
628 void Bus::SendWithReply(DBusMessage* request,
639 void Bus::Send(DBusMessage* request, uint32* serial) {
647 bool Bus::AddFilterFunction(DBusHandleMessageFunction filter_function,
668 bool Bus::RemoveFilterFunction(DBusHandleMessageFunction filter_function,
688 void Bus::AddMatch(const std::string& match_rule, DBusError* error) {
706 bool Bus::RemoveMatch(const std::string& match_rule, DBusError* error) {
726 bool Bus::TryRegisterObjectPath(const ObjectPath& object_path,
750 void Bus::UnregisterObjectPath(const ObjectPath& object_path) {
768 void Bus::ShutdownOnDBusThreadAndBlockInternal() {
775 void Bus::ProcessAllIncomingDataIfAny() {
793 void Bus::PostTaskToDBusThreadAndReply(
801 LOG(WARNING) << "Failed to post a task to the D-Bus thread message loop";
811 void Bus::PostTaskToOriginThread(const tracked_objects::Location& from_here,
819 void Bus::PostTaskToDBusThread(const tracked_objects::Location& from_here,
823 LOG(WARNING) << "Failed to post a task to the D-Bus thread message loop";
833 void Bus::PostDelayedTaskToDBusThread(
840 LOG(WARNING) << "Failed to post a task to the D-Bus thread message loop";
850 bool Bus::HasDBusThread() {
854 void Bus::AssertOnOriginThread() {
858 void Bus::AssertOnDBusThread() {
868 std::string Bus::GetServiceOwnerAndBlock(const std::string& service_name,
907 void Bus::GetServiceOwner(const std::string& service_name,
913 base::Bind(&Bus::GetServiceOwnerInternal, this, service_name, callback));
916 void Bus::GetServiceOwnerInternal(const std::string& service_name,
926 void Bus::ListenForServiceOwnerChange(
934 base::Bind(&Bus::ListenForServiceOwnerChangeInternal,
938 void Bus::ListenForServiceOwnerChangeInternal(
950 AddFilterFunction(Bus::OnServiceOwnerChangedFilter, this);
982 void Bus::UnlistenForServiceOwnerChange(
990 base::Bind(&Bus::UnlistenForServiceOwnerChangeInternal,
994 void Bus::UnlistenForServiceOwnerChangeInternal(
1027 RemoveFilterFunction(Bus::OnServiceOwnerChangedFilter, this);
1032 dbus_bool_t Bus::OnAddWatch(DBusWatch* raw_watch) {
1044 void Bus::OnRemoveWatch(DBusWatch* raw_watch) {
1052 void Bus::OnToggleWatch(DBusWatch* raw_watch) {
1065 dbus_bool_t Bus::OnAddTimeout(DBusTimeout* raw_timeout) {
1078 void Bus::OnRemoveTimeout(DBusTimeout* raw_timeout) {
1086 void Bus::OnToggleTimeout(DBusTimeout* raw_timeout) {
1097 void Bus::OnDispatchStatusChanged(DBusConnection* connection,
1104 // prohibited by the D-Bus library. Hence, we post a task here instead.
1107 base::Bind(&Bus::ProcessAllIncomingDataIfAny,
1111 void Bus::OnConnectionDisconnected(DBusConnection* connection) {
1124 void Bus::OnServiceOwnerChanged(DBusMessage* message) {
1163 dbus_bool_t Bus::OnAddWatchThunk(DBusWatch* raw_watch, void* data) {
1164 Bus* self = static_cast<Bus*>(data);
1169 void Bus::OnRemoveWatchThunk(DBusWatch* raw_watch, void* data) {
1170 Bus* self = static_cast<Bus*>(data);
1175 void Bus::OnToggleWatchThunk(DBusWatch* raw_watch, void* data) {
1176 Bus* self = static_cast<Bus*>(data);
1181 dbus_bool_t Bus::OnAddTimeoutThunk(DBusTimeout* raw_timeout, void* data) {
1182 Bus* self = static_cast<Bus*>(data);
1187 void Bus::OnRemoveTimeoutThunk(DBusTimeout* raw_timeout, void* data) {
1188 Bus* self = static_cast<Bus*>(data);
1193 void Bus::OnToggleTimeoutThunk(DBusTimeout* raw_timeout, void* data) {
1194 Bus* self = static_cast<Bus*>(data);
1199 void Bus::OnDispatchStatusChangedThunk(DBusConnection* connection,
1202 Bus* self = static_cast<Bus*>(data);
1207 DBusHandlerResult Bus::OnConnectionDisconnectedFilter(
1214 Bus* self = static_cast<Bus*>(data);
1222 DBusHandlerResult Bus::OnServiceOwnerChangedFilter(
1229 Bus* self = static_cast<Bus*>(data);