| 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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 void RunResponseCallback(ResponseCallback response_callback, | 197 void RunResponseCallback(ResponseCallback response_callback, |
| 198 ErrorCallback error_callback, | 198 ErrorCallback error_callback, |
| 199 base::TimeTicks start_time, | 199 base::TimeTicks start_time, |
| 200 DBusMessage* response_message); | 200 DBusMessage* response_message); |
| 201 | 201 |
| 202 // Redirects the function call to OnPendingCallIsComplete(). | 202 // Redirects the function call to OnPendingCallIsComplete(). |
| 203 static void OnPendingCallIsCompleteThunk(DBusPendingCall* pending_call, | 203 static void OnPendingCallIsCompleteThunk(DBusPendingCall* pending_call, |
| 204 void* user_data); | 204 void* user_data); |
| 205 | 205 |
| 206 // Helper function for ConnectToSignal(). | 206 // Helper function for ConnectToSignal(). |
| 207 void ConnectToSignalInternal( | 207 bool ConnectToSignalInternal(const std::string& interface_name, |
| 208 const std::string& interface_name, | 208 const std::string& signal_name, |
| 209 const std::string& signal_name, | 209 SignalCallback signal_callback); |
| 210 SignalCallback signal_callback, | |
| 211 OnConnectedCallback on_connected_callback); | |
| 212 | |
| 213 // Called when the object proxy is connected to the signal, or failed. | |
| 214 void OnConnected(OnConnectedCallback on_connected_callback, | |
| 215 const std::string& interface_name, | |
| 216 const std::string& signal_name, | |
| 217 bool success); | |
| 218 | 210 |
| 219 // Handles the incoming request messages and dispatches to the signal | 211 // Handles the incoming request messages and dispatches to the signal |
| 220 // callbacks. | 212 // callbacks. |
| 221 DBusHandlerResult HandleMessage(DBusConnection* connection, | 213 DBusHandlerResult HandleMessage(DBusConnection* connection, |
| 222 DBusMessage* raw_message); | 214 DBusMessage* raw_message); |
| 223 | 215 |
| 224 // Runs the method. Helper function for HandleMessage(). | 216 // Runs the method. Helper function for HandleMessage(). |
| 225 void RunMethod(base::TimeTicks start_time, | 217 void RunMethod(base::TimeTicks start_time, |
| 226 std::vector<SignalCallback> signal_callbacks, | 218 std::vector<SignalCallback> signal_callbacks, |
| 227 Signal* signal); | 219 Signal* signal); |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 282 | 274 |
| 283 // 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_|. |
| 284 std::string service_name_owner_; | 276 std::string service_name_owner_; |
| 285 | 277 |
| 286 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); | 278 DISALLOW_COPY_AND_ASSIGN(ObjectProxy); |
| 287 }; | 279 }; |
| 288 | 280 |
| 289 } // namespace dbus | 281 } // namespace dbus |
| 290 | 282 |
| 291 #endif // DBUS_OBJECT_PROXY_H_ | 283 #endif // DBUS_OBJECT_PROXY_H_ |
| OLD | NEW |