| 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 "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/message_loop_proxy.h" | 10 #include "base/message_loop_proxy.h" |
| (...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 FROM_HERE, | 879 FROM_HERE, |
| 880 base::Bind(&Bus::GetServiceOwnerInternal, this, service_name, callback)); | 880 base::Bind(&Bus::GetServiceOwnerInternal, this, service_name, callback)); |
| 881 } | 881 } |
| 882 | 882 |
| 883 void Bus::GetServiceOwnerInternal(const std::string& service_name, | 883 void Bus::GetServiceOwnerInternal(const std::string& service_name, |
| 884 const GetServiceOwnerCallback& callback) { | 884 const GetServiceOwnerCallback& callback) { |
| 885 AssertOnDBusThread(); | 885 AssertOnDBusThread(); |
| 886 | 886 |
| 887 std::string service_owner; | 887 std::string service_owner; |
| 888 if (Connect()) | 888 if (Connect()) |
| 889 service_owner = GetServiceOwnerAndBlock(service_name, REPORT_ERRORS); | 889 service_owner = GetServiceOwnerAndBlock(service_name, SUPPRESS_ERRORS); |
| 890 PostTaskToOriginThread(FROM_HERE, base::Bind(callback, service_owner)); | 890 PostTaskToOriginThread(FROM_HERE, base::Bind(callback, service_owner)); |
| 891 } | 891 } |
| 892 | 892 |
| 893 dbus_bool_t Bus::OnAddWatch(DBusWatch* raw_watch) { | 893 dbus_bool_t Bus::OnAddWatch(DBusWatch* raw_watch) { |
| 894 AssertOnDBusThread(); | 894 AssertOnDBusThread(); |
| 895 | 895 |
| 896 // watch will be deleted when raw_watch is removed in OnRemoveWatch(). | 896 // watch will be deleted when raw_watch is removed in OnRemoveWatch(). |
| 897 Watch* watch = new Watch(raw_watch); | 897 Watch* watch = new Watch(raw_watch); |
| 898 if (watch->IsReadyToBeWatched()) { | 898 if (watch->IsReadyToBeWatched()) { |
| 899 watch->StartWatching(); | 899 watch->StartWatching(); |
| (...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 kDisconnectedSignal)) { | 1028 kDisconnectedSignal)) { |
| 1029 Bus* self = static_cast<Bus*>(data); | 1029 Bus* self = static_cast<Bus*>(data); |
| 1030 self->AssertOnDBusThread(); | 1030 self->AssertOnDBusThread(); |
| 1031 self->OnConnectionDisconnected(connection); | 1031 self->OnConnectionDisconnected(connection); |
| 1032 return DBUS_HANDLER_RESULT_HANDLED; | 1032 return DBUS_HANDLER_RESULT_HANDLED; |
| 1033 } | 1033 } |
| 1034 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; | 1034 return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; |
| 1035 } | 1035 } |
| 1036 | 1036 |
| 1037 } // namespace dbus | 1037 } // namespace dbus |
| OLD | NEW |