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_OBJECT_PROXY_H_ | 5 #ifndef DBUS_OBJECT_PROXY_H_ |
6 #define DBUS_OBJECT_PROXY_H_ | 6 #define DBUS_OBJECT_PROXY_H_ |
7 | 7 |
8 #include <dbus/dbus.h> | 8 #include <dbus/dbus.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 | 171 |
172 // Sets a callback for "NameOwnerChanged" signal. The callback is called on | 172 // Sets a callback for "NameOwnerChanged" signal. The callback is called on |
173 // the origin thread when D-Bus system sends "NameOwnerChanged" for the name | 173 // the origin thread when D-Bus system sends "NameOwnerChanged" for the name |
174 // represented by |service_name_|. | 174 // represented by |service_name_|. |
175 virtual void SetNameOwnerChangedCallback(NameOwnerChangedCallback callback); | 175 virtual void SetNameOwnerChangedCallback(NameOwnerChangedCallback callback); |
176 | 176 |
177 // Runs the callback as soon as the service becomes available. | 177 // Runs the callback as soon as the service becomes available. |
178 virtual void WaitForServiceToBeAvailable( | 178 virtual void WaitForServiceToBeAvailable( |
179 WaitForServiceToBeAvailableCallback callback); | 179 WaitForServiceToBeAvailableCallback callback); |
180 | 180 |
| 181 // Returns true if the service is available (i.e. its name has an owner). |
| 182 virtual bool ServiceIsAvailable(); |
| 183 |
181 // Detaches from the remote object. The Bus object will take care of | 184 // Detaches from the remote object. The Bus object will take care of |
182 // detaching so you don't have to do this manually. | 185 // detaching so you don't have to do this manually. |
183 // | 186 // |
184 // BLOCKING CALL. | 187 // BLOCKING CALL. |
185 virtual void Detach(); | 188 virtual void Detach(); |
186 | 189 |
187 const ObjectPath& object_path() const { return object_path_; } | 190 const ObjectPath& object_path() const { return object_path_; } |
188 | 191 |
189 // Returns an empty callback that does nothing. Can be used for | 192 // Returns an empty callback that does nothing. Can be used for |
190 // CallMethod(). | 193 // CallMethod(). |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 std::string service_name_owner_; | 327 std::string service_name_owner_; |
325 | 328 |
326 std::set<DBusPendingCall*> pending_calls_; | 329 std::set<DBusPendingCall*> pending_calls_; |
327 | 330 |
328 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); | 331 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); |
329 }; | 332 }; |
330 | 333 |
331 } // namespace dbus | 334 } // namespace dbus |
332 | 335 |
333 #endif // DBUS_OBJECT_PROXY_H_ | 336 #endif // DBUS_OBJECT_PROXY_H_ |
OLD | NEW |