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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 // be passed to the callback. If unsuccessful, the error callback will be | 139 // be passed to the callback. If unsuccessful, the error callback will be |
140 // called and a pointer to ErrorResponse object will be passed to the error | 140 // called and a pointer to ErrorResponse object will be passed to the error |
141 // callback if available, otherwise NULL will be passed. | 141 // callback if available, otherwise NULL will be passed. |
142 // | 142 // |
143 // Must be called in the origin thread. | 143 // Must be called in the origin thread. |
144 virtual void CallMethodWithErrorCallback(MethodCall* method_call, | 144 virtual void CallMethodWithErrorCallback(MethodCall* method_call, |
145 int timeout_ms, | 145 int timeout_ms, |
146 ResponseCallback callback, | 146 ResponseCallback callback, |
147 ErrorCallback error_callback); | 147 ErrorCallback error_callback); |
148 | 148 |
149 // Requests to connect to the signal from the remote object, replacing | 149 // Requests to connect to the signal from the remote object. |
150 // any previous |signal_callback| connected to that signal. | |
151 // | 150 // |
152 // |signal_callback| will be called in the origin thread, when the | 151 // |signal_callback| will be called in the origin thread, when the |
153 // signal is received from the remote object. As it's called in the | 152 // signal is received from the remote object. As it's called in the |
154 // origin thread, |signal_callback| can safely reference objects in the | 153 // origin thread, |signal_callback| can safely reference objects in the |
155 // origin thread (i.e. UI thread in most cases). | 154 // origin thread (i.e. UI thread in most cases). |
156 // | 155 // |
157 // |on_connected_callback| is called when the object proxy is connected | 156 // |on_connected_callback| is called when the object proxy is connected |
158 // to the signal, or failed to be connected, in the origin thread. | 157 // to the signal, or failed to be connected, in the origin thread. |
159 // | 158 // |
| 159 // If a SignalCallback has already been registered for the given |
| 160 // |interface_name| and |signal_name|, |signal_callback| will be |
| 161 // added to the list of callbacks for |interface_name| and |
| 162 // |signal_name|. |
| 163 // |
160 // Must be called in the origin thread. | 164 // Must be called in the origin thread. |
161 virtual void ConnectToSignal(const std::string& interface_name, | 165 virtual void ConnectToSignal(const std::string& interface_name, |
162 const std::string& signal_name, | 166 const std::string& signal_name, |
163 SignalCallback signal_callback, | 167 SignalCallback signal_callback, |
164 OnConnectedCallback on_connected_callback); | 168 OnConnectedCallback on_connected_callback); |
165 | 169 |
166 // Sets a callback for "NameOwnerChanged" signal. The callback is called on | 170 // Sets a callback for "NameOwnerChanged" signal. The callback is called on |
167 // the origin thread when D-Bus system sends "NameOwnerChanged" for the name | 171 // the origin thread when D-Bus system sends "NameOwnerChanged" for the name |
168 // represented by |service_name_|. | 172 // represented by |service_name_|. |
169 virtual void SetNameOwnerChangedCallback(NameOwnerChangedCallback callback); | 173 virtual void SetNameOwnerChangedCallback(NameOwnerChangedCallback callback); |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
317 std::string service_name_owner_; | 321 std::string service_name_owner_; |
318 | 322 |
319 std::set<DBusPendingCall*> pending_calls_; | 323 std::set<DBusPendingCall*> pending_calls_; |
320 | 324 |
321 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); | 325 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); |
322 }; | 326 }; |
323 | 327 |
324 } // namespace dbus | 328 } // namespace dbus |
325 | 329 |
326 #endif // DBUS_OBJECT_PROXY_H_ | 330 #endif // DBUS_OBJECT_PROXY_H_ |
OLD | NEW |