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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 // Called when the object proxy is connected to the signal. | 74 // Called when the object proxy is connected to the signal. |
75 // Parameters: | 75 // Parameters: |
76 // - the interface name. | 76 // - the interface name. |
77 // - the signal name. | 77 // - the signal name. |
78 // - whether it was successful or not. | 78 // - whether it was successful or not. |
79 typedef base::Callback<void (const std::string&, const std::string&, bool)> | 79 typedef base::Callback<void (const std::string&, const std::string&, bool)> |
80 OnConnectedCallback; | 80 OnConnectedCallback; |
81 | 81 |
82 // Calls the method of the remote object and blocks until the response | 82 // Calls the method of the remote object and blocks until the response |
83 // is returned. Returns NULL on error. | 83 // is returned. Returns NULL on error. |
84 // The caller is responsible to delete the returned object. | |
85 // | 84 // |
86 // BLOCKING CALL. | 85 // BLOCKING CALL. |
87 virtual Response* CallMethodAndBlock(MethodCall* method_call, | 86 virtual scoped_ptr<Response> CallMethodAndBlock(MethodCall* method_call, |
88 int timeout_ms); | 87 int timeout_ms); |
89 | 88 |
90 // Requests to call the method of the remote object. | 89 // Requests to call the method of the remote object. |
91 // | 90 // |
92 // |callback| will be called in the origin thread, once the method call | 91 // |callback| will be called in the origin thread, once the method call |
93 // is complete. As it's called in the origin thread, |callback| can | 92 // is complete. As it's called in the origin thread, |callback| can |
94 // safely reference objects in the origin thread (i.e. UI thread in most | 93 // safely reference objects in the origin thread (i.e. UI thread in most |
95 // cases). If the caller is not interested in the response from the | 94 // cases). If the caller is not interested in the response from the |
96 // method (i.e. calling a method that does not return a value), | 95 // method (i.e. calling a method that does not return a value), |
97 // EmptyResponseCallback() can be passed to the |callback| parameter. | 96 // EmptyResponseCallback() can be passed to the |callback| parameter. |
98 // | 97 // |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
282 | 281 |
283 // Known name owner of the well-known bus name represnted by |service_name_|. | 282 // Known name owner of the well-known bus name represnted by |service_name_|. |
284 std::string service_name_owner_; | 283 std::string service_name_owner_; |
285 | 284 |
286 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); | 285 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); |
287 }; | 286 }; |
288 | 287 |
289 } // namespace dbus | 288 } // namespace dbus |
290 | 289 |
291 #endif // DBUS_OBJECT_PROXY_H_ | 290 #endif // DBUS_OBJECT_PROXY_H_ |
OLD | NEW |