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> |
11 #include <set> | 11 #include <set> |
12 #include <string> | 12 #include <string> |
13 | 13 |
14 #include "base/callback.h" | 14 #include "base/callback.h" |
15 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
16 #include "base/string_piece.h" | 16 #include "base/string_piece.h" |
17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "dbus/dbus_export.h" |
18 #include "dbus/object_path.h" | 19 #include "dbus/object_path.h" |
19 | 20 |
20 namespace dbus { | 21 namespace dbus { |
21 | 22 |
22 class Bus; | 23 class Bus; |
23 class ErrorResponse; | 24 class ErrorResponse; |
24 class MethodCall; | 25 class MethodCall; |
25 class Response; | 26 class Response; |
26 class Signal; | 27 class Signal; |
27 | 28 |
28 // ObjectProxy is used to communicate with remote objects, mainly for | 29 // ObjectProxy is used to communicate with remote objects, mainly for |
29 // calling methods of these objects. | 30 // calling methods of these objects. |
30 // | 31 // |
31 // ObjectProxy is a ref counted object, to ensure that |this| of the | 32 // ObjectProxy is a ref counted object, to ensure that |this| of the |
32 // object is is alive when callbacks referencing |this| are called; the | 33 // object is is alive when callbacks referencing |this| are called; the |
33 // bus always holds at least one of those references so object proxies | 34 // bus always holds at least one of those references so object proxies |
34 // always last as long as the bus that created them. | 35 // always last as long as the bus that created them. |
35 class ObjectProxy : public base::RefCountedThreadSafe<ObjectProxy> { | 36 class CHROME_DBUS_EXPORT ObjectProxy |
| 37 : public base::RefCountedThreadSafe<ObjectProxy> { |
36 public: | 38 public: |
37 // Client code should use Bus::GetObjectProxy() or | 39 // Client code should use Bus::GetObjectProxy() or |
38 // Bus::GetObjectProxyWithOptions() instead of this constructor. | 40 // Bus::GetObjectProxyWithOptions() instead of this constructor. |
39 ObjectProxy(Bus* bus, | 41 ObjectProxy(Bus* bus, |
40 const std::string& service_name, | 42 const std::string& service_name, |
41 const ObjectPath& object_path, | 43 const ObjectPath& object_path, |
42 int options); | 44 int options); |
43 | 45 |
44 // Options to be OR-ed together when calling Bus::GetObjectProxyWithOptions(). | 46 // Options to be OR-ed together when calling Bus::GetObjectProxyWithOptions(). |
45 // Set the IGNORE_SERVICE_UNKNOWN_ERRORS option to silence logging of | 47 // Set the IGNORE_SERVICE_UNKNOWN_ERRORS option to silence logging of |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 | 274 |
273 // Known name owner of the well-known bus name represnted by |service_name_|. | 275 // Known name owner of the well-known bus name represnted by |service_name_|. |
274 std::string service_name_owner_; | 276 std::string service_name_owner_; |
275 | 277 |
276 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); | 278 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); |
277 }; | 279 }; |
278 | 280 |
279 } // namespace dbus | 281 } // namespace dbus |
280 | 282 |
281 #endif // DBUS_OBJECT_PROXY_H_ | 283 #endif // DBUS_OBJECT_PROXY_H_ |
OLD | NEW |